Skip to content

Instantly share code, notes, and snippets.

@dnicolson
dnicolson / iOSKeyboardEscapeKeyEnablerBluetooth.c
Created January 23, 2019 23:47
Support for the corner home button on an iOS keyboard to act as an escape key by analysing Bluetooth packets
// clang -framework Carbon iOSKeyboardEscapeKeyEnablerBluetooth.c -o iOSKeyboardEscapeKeyEnablerBluetooth
// sudo ./iOSKeyboardEscapeKeyEnablerBluetooth
#include <stdio.h>
#include <stdlib.h>
#include <Carbon/Carbon.h>
void TriggerEscKey()
{
CGEventRef event;
@labeneator
labeneator / etc_cron.d_ubnt_metrics
Last active August 28, 2021 17:40
Script to send SNMP metrics from Ubiquiti devices to graphite.
* * * * * root /usr/local/bin/send_metrics.sh
@dnicolson
dnicolson / dropbox-git.sh
Created November 4, 2018 16:35
Clone a bare git repo from Dropbox
curl -L https://www.dropbox.com/sh/xxx/yyy > project.git.zip
mkdir project.git
unzip project.git.zip -d project.git
git clone project.git
rm project.git.zip
rm -rf project.git
Ranked by discretionary assets managed in hedge funds worldwide, in millions, as of June 30, 2018, unless otherwise noted.
Rank Manager Assets Change from 2017
1 Bridgewater Associates $132,756 7.9%
2 AQR Capital Mgmt. $83,700 9.2%
3 Man Group $59,100 11.3%
4 Renaissance Technologies $57,000 17.3%
5 Two Sigma Inv./Two Sigma Advisers $38,800 9.6%
6 Millennium Mgmt. $35,314 2.7%
7 Elliott Management $35,000 7.0%
@loganvolkers
loganvolkers / Byte Formatting for Google Sheets.md
Last active June 25, 2026 11:19
Byte formatting for Google Sheets
@miguelmota
miguelmota / process_names.txt
Last active May 20, 2026 20:20
macOS process whitelist
# not an exhaustive list
nsurlsessiond "icloud sync"
fseventsd "macos file system events"
WindowServer "macos windows"
DisplayLinkManager "macos driver"
configd "macos dynamic configuration"
displaypolicyd "macos process"
CommCenter "macos keychain"
kernel_task "macos kernel"
@Jahhein
Jahhein / README.md
Last active September 8, 2025 09:12
Display Apple AirPods battery levels via Terminal

Update: New output icon glyph

You can find information on my terminal configuration here

# python3 version, derived from python2 version https://gist.github.com/dergachev/7028596
#
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python3 simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
@ysimonson
ysimonson / bluetooth_sleep.lua
Last active March 23, 2026 13:12
Hammerspoon script to disable bluetooth when the computer is put to sleep. Requires `blueutil` to be installed (`brew install blueutil`).
require "string"
function checkBluetoothResult(rc, stderr, stderr)
if rc ~= 0 then
print(string.format("Unexpected result executing `blueutil`: rc=%d stderr=%s stdout=%s", rc, stderr, stdout))
end
end
function bluetooth(power)
print("Setting bluetooth to " .. power)
@fgr0
fgr0 / _tmutil
Last active January 10, 2023 00:14
zsh autocompletion for macOS tmutil
#compdef tmutil
# Autocompletion for macOS `tmutil`
#
# utility functions
#
# tmutil <verbs>
__tmutil_verbs() {
local -a allverbs