This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /System/Library/LaunchDaemons /System/Library/LaunchAgents -name "*.plist" \ | |
| while read p ; do plutil -convert json -o - ${p} \ | |
| jq -r ' .. | objects | with_entries(select(.key == "Notification")) | select(. != {}).Notification' | |
done | sort -u > ~/Desktop/all-launchd-notifications.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Save Code Snippets | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Add a button to save code snippets from ChatGPT responses | |
// @author dre | |
// @match https://chat.openai.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com | |
// @grant GM_download | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
TARGET=$1 | |
# to be used as an egrep pattern | |
SYMS='getprogname|NSGetArgv|NSGetArgc|optarg|optind|getopt|getopt_long' | |
sudo find ${TARGET} -type f -perm +111 \! -name "*.dylib" | \ | |
while read f ; do | |
sudo nm -u ${f} 2> /dev/null | \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Scenario: | |
# - you have a local checkout of a github repo | |
# - you're looking at public forks of that repo | |
# - you want to add a remote to your local checkout for one of the forks | |
set -e | |
set -o pipefail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python -u | |
import re | |
from datetime import datetime | |
import click | |
import subprocess | |
import json | |
""" | |
NOTE: this requires a log config profile that enables 'private data' logging. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use scripting additions | |
use framework "Foundation" | |
tell application "Finder" | |
-- path to frontmost Finder window | |
set windowPath to POSIX path of (target of front window as alias) | |
-- selected items in Finder, if any | |
set itemlist to selection as alias list | |
if length of itemlist > 0 then | |
repeat with i from 1 to length of itemlist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import parselmouth | |
# import IPython | |
import os | |
import sys | |
import pandas as pd | |
# Feed me audio files as command line arguments | |
# uncomment this to stop pandas from being so coy in its repr()s | |
# pd.set_option("display.max_rows", None, "display.max_columns", None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http.server | |
import socketserver | |
import random | |
import os | |
import uuid | |
from http import HTTPStatus | |
''' | |
I wanted a quick way to spawn a bunch of Safari tabs with distinct favicons, so made a little webserver | |
to rotate through some PNGs. A substantially smaller program was sufficient for Chrome, which does what |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>PayloadContent</key> | |
<array> | |
<dict> | |
<key>PayloadDisplayName</key> | |
<string>ManagedClient logging</string> | |
<key>PayloadEnabled</key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python | |
# To use this, you need Python 3 and also the pyobjc module. | |
# pip install pyobjc | |
import objc | |
from Foundation import NSBundle, NSString | |
import datetime | |
import time | |
import sys |
NewerOlder