Skip to content

Instantly share code, notes, and snippets.

View jevinskie's full-sized avatar

Jevin Sweval jevinskie

View GitHub Profile
@jevinskie
jevinskie / clickScreenshotWindowMarkupButton.m
Created December 7, 2025 01:34 — forked from hym3242/clickScreenshotWindowMarkupButton.m
A objc program that clicks the "markup" button in "com.apple.screencaptureui" application 's "ScreenshotAnnotationWindow" (titled "Screenshot")
// compile with: cc clickScreenshotWindowMarkupButton.m -o clickScreenshotWindowMarkupButton -framework Cocoa
// This program clicks the "markup" button in "com.apple.screencaptureui" application 's "ScreenshotAnnotationWindow" (titled "Screenshot")
// Mostly written by the obviously-dumber-than-first-launched ChatGPT 4 Classic. No rights reserved.
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
// Function to find the PID using bundle identifier
pid_t pidForBundleIdentifier(NSString *bundleIdentifier) {
NSArray *apps = [NSRunningApplication runningApplicationsWithBundleIdentifier:bundleIdentifier];
@jevinskie
jevinskie / macos-zlib-fix-MACOS-TARGET_OS_MAC.sh
Created October 21, 2025 18:35
how to fix annoying xcode 26 or late 16 betas zlib build failure (TARGET_OS_MAC and MACOS macros)
# single file
sd -F '#if defined(MACOS) || defined(TARGET_OS_MAC)' '#if !defined(__APPLE__) && (defined(MACOS) || defined(TARGET_OS_MAC))' zlib/zutil.h
# YOLO, probably works for you
for f in $(fd -HI zutil.h .); sd -F '#if defined(MACOS) || defined(TARGET_OS_MAC)' '#if !defined(__APPLE__) && (defined(MACOS) || defined(TARGET_OS_MAC))' "$f"
@jevinskie
jevinskie / clang-Format-condensed.hpp
Created October 20, 2025 19:46
Condensed C++ clang/Format/Format.h (use `gcc -E -fpreprocessed -dD -P llvm-project/clang/include/clang/Format/Format.h`)
#ifndef LLVM_CLANG_FORMAT_FORMAT_H
#define LLVM_CLANG_FORMAT_FORMAT_H
#include "clang/Basic/LangOptions.h"
#include "clang/Tooling/Core/Replacement.h"
#include "clang/Tooling/Inclusions/IncludeStyle.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/Regex.h"
#include "llvm/Support/SourceMgr.h"
#include <optional>
#include <system_error>
@jevinskie
jevinskie / lafayette-indiana-acording-to-ggml-org-gemma-3-1b-it-GGUF.md
Created September 20, 2025 20:27
Lafayette, Indiana according to ggml-org/gemma-3-1b-it-GGUF

Prompt

tell me about lafayette indiana

Response

Lafayette, Indiana is a vibrant and historic city nestled in the heart of the Indiana countryside, steeped in a rich blend of Midwestern charm, military heritage, and a surprisingly dynamic arts scene. Here’s a breakdown of what makes Lafayette special:

History & Heritage - A Military Legacy:

  • Founding as a Military Base: Lafayette was founded in 1824 as a military outpost named “Lafayette’s Point,” and later became the first military base in the Indiana Territory. This history profoundly shaped the city’s identity – it was a strategic point for defense and a hub for military activity.
@jevinskie
jevinskie / reposurgeon-subversion-rsync-conversion.md
Created September 18, 2025 15:37
reposurgeon subversion rsync conversion

reposurgeon git diff (probably to fix sourceforge rsync issue?):

diff --git a/tool/repotool.go b/tool/repotool.go
index 016a9272..0abcaca2 100644
--- a/tool/repotool.go
+++ b/tool/repotool.go
@@ -589,7 +589,7 @@ func mirror(args []string) {
 		// Those can't be tested locally and they tell rsync to look for rsyncd on the server
 // side. So, we're going to transform the source address to a : spec.
@jevinskie
jevinskie / type_rewriter.py
Created July 10, 2025 20:51
Python typing hell - decorated descriptors
from __future__ import annotations
from collections.abc import Callable
from types import MappingProxyType
from typing import TYPE_CHECKING, Any, Concatenate, Generic, ParamSpec, TypeVar, cast, overload
_T = TypeVar("_T")
_F = TypeVar("_F", bound=Callable[..., Any])
_P = ParamSpec("_P")
_R_co = TypeVar("_R_co", covariant=True)
@jevinskie
jevinskie / traits.md
Last active July 4, 2025 19:41
Traits: A Mechanism for Fine-grained Reuse

Traits: A Mechanism for Fine-grained Reuse

ST EPHANE DUCASSE [´]

Software Composition Group, University of Berne and Language and Software Evolution Group, LTI — LISTIC, Universit´e de Savoie

and OSCAR NIERSTRASZ and NATHANAEL SCH ARLI [¨]

@jevinskie
jevinskie / git-bisect-cpython.sh
Created July 3, 2025 14:46
git bisect for finding a change in bytecode behavior in CPython
#!/usr/bin/env bash
set -xeuo pipefail
echo "=== GIT STATUS ==="
git status
git clean -fdx &> /dev/null
rm -rf ~/base/python-dumb/*
@jevinskie
jevinskie / lm32-decode.c
Created June 4, 2025 22:02
lm32 QEMU decodetree
/* This file is autogenerated by scripts/decodetree.py. */
typedef struct {
int rX;
int csr;
} arg_cr;
typedef struct {
int imm;
} arg_i;
@jevinskie
jevinskie / decodetree.c
Created June 3, 2025 20:57
QEMU decodetree example
/* This file is autogenerated by scripts/decodetree.py. */
typedef struct {
int reg0;
int reg1;
int imm16;
} arg_ri;
typedef arg_ri arg_addi;
static bool trans_addi(DisasContext *ctx, arg_addi *a);