Skip to content

Instantly share code, notes, and snippets.

@varenc
varenc / pet-snippet.toml
Last active October 27, 2025 15:56
description
[[Snippets]]
Description = "my personal snippets. Relies on many of my own functions. If you're interested in pmset/disabling assertions, see: https://gist.github.com/varenc/627f6be2a5ec9d52dab3cf0d157be62f"
Output = ""
Tag = []
command = ""
[[Snippets]]
Description = "start dev file syncer. uses fswatch to know when to run rsync. does not sync .git file. Sort like a write-through cache network file system with only eventual consistency guarantees."
Output = ""
@schollz
schollz / pet-snippet.toml
Last active December 7, 2022 11:08
description
[[snippets]]
description = "Grep all files in a folder"
command = "grep -rn \"texthere\" ."
output = ""
[[snippets]]
description = "Sync only certain files using filters and rsync"
command = "rsync -rv --include '*/' --include '*something*' --exclude '*' --prune-empty-dirs Source/ Target/"
output = ""
@patrickfuller
patrickfuller / alias_dns.py
Last active August 4, 2024 05:00
Enables local DNS resolution of Unifi aliases
"""
When run in cron, automatically adds compliant alias names to local DNS.
Use at your own risk.
Patrick Fuller, 25 June 17
"""
import re
import paramiko
import pymongo
@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
@ysimonson
ysimonson / bluetooth_sleep.lua
Last active July 29, 2025 20:55
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)
# 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
@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

@miguelmota
miguelmota / process_names.txt
Last active August 13, 2024 09:58
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"
@loganvolkers
loganvolkers / Byte Formatting for Google Sheets.md
Last active September 29, 2025 14:20
Byte formatting for Google Sheets
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%