Skip to content

Instantly share code, notes, and snippets.

View hym3242's full-sized avatar
💭
still lovin' TIOCSTI

hym3242 hym3242

💭
still lovin' TIOCSTI
View GitHub Profile
@hym3242
hym3242 / clickScreenshotWindowMarkupButton.m
Last active May 16, 2024 01:14
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];
@hym3242
hym3242 / SkyLightInternals.c
Created May 20, 2024 09:02
Uses some SkyLight private symbols to print some useful stuff
//cc SLsymtest.c -g -o SLsymtest -framework Carbon -undefined dynamic_lookup
#include <unistd.h>
#include <stdio.h>
#include <CoreFoundation/CoreFoundation.h>
#include <CoreGraphics/CoreGraphics.h>
#include <ApplicationServices/ApplicationServices.h>
void SLDisplayDefaultVisualBell();
void SLSGetDebugOptions(int* options);
@hym3242
hym3242 / sonoma-text-insertion-point-downgrade.jxa.js
Created September 16, 2024 15:48 — forked from stephancasas/sonoma-text-insertion-point-downgrade.jxa.js
Disable Sonoma Text Insertion Point ("Cursor" / "Caret")
#!/usr/bin/env osascript -l JavaScript
const App = Application.currentApplication();
App.includeStandardAdditions = true;
const kCFPrefsFeatureFlagsDir = '/Library/Preferences/FeatureFlags/Domain';
const kCFPrefsFeatureEnabledKey = 'Enabled';
const kUIKitDomainPrefsTemporaryPath = '/tmp/UIKit.plist';
const kUIKitRedesignedTextCursorKey = 'redesigned_text_cursor';
@hym3242
hym3242 / get-childitem_recursive_ffmpeg_qsv_scrub_find_errors.ps1
Last active January 9, 2025 07:30
Recusively list medida files, use ffmpeg (with hwaccel qsv) to scrub the files (attempt to decode from start to end) to find errors
#$ErrorView = "Basic"
# Suppresses all errors globally in the script/session
#$ErrorActionPreference = "SilentlyContinue" #causes script to stuck at get-childitem
param(
[string]$rootfolderarg
)
function Sanitize-FileName {
param ([string]$fileName)
@hym3242
hym3242 / IAfavlistgen
Created November 18, 2024 09:44
Generate Internet Archive favlist of identifiers
jq -r '.request.backend_requests | to_entries[] | select(.key | test("^favorites_doc")) | .value.finalized_parameters.doc_ids[]'