Skip to content

Instantly share code, notes, and snippets.

View luckman212's full-sized avatar

Luke Hamburg luckman212

View GitHub Profile
@luckman212
luckman212 / gist:b4d4ee80bbea5bdfae741213b2d29ae0
Created December 23, 2021 15:31
Netgate 6100 - CORDOBA BOOT 02.02.00.00t-uc-15
02.02.00.00t-uc-15
@luckman212
luckman212 / devteamid.sh
Last active October 17, 2024 12:49
grab Apple DEVELOPMENT_TEAM ID from Keychain
#!/usr/bin/env bash
CODESIGN_CN_STRING='Developer ID Application'
#CODESIGN_CN_STRING='Apple Development'
#requires openssl@3 from Homebrew
_openssl=$(brew --prefix openssl 2>/dev/null)/bin/openssl
[[ -x $_openssl ]] || { echo "missing openssl, try \`brew install openssl\`"; exit 1; }
#find development cert
@luckman212
luckman212 / rgr
Created December 23, 2021 18:25
rgr: quick in-place search and replace using ripgrep + gsed
#!/usr/bin/env bash
case $1 in
-h|--help|'') echo "usage: ${0##*/} <old> <new>"; exit;;
esac
export old="\b$1\b"
export new=$2
rg --files-with-matches -0 "${old}" |
@luckman212
luckman212 / animations.sh
Created December 29, 2021 22:33
Enable / Disable / Revert animation-related tweaks to macOS
#!/usr/bin/env bash
function _nl() {
read -r LINE
echo "${LINE:-null}"
}
function _write() {
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
defaults write -g NSScrollAnimationEnabled -bool false
@luckman212
luckman212 / init.lua
Created January 2, 2022 18:28
init.lua for Hammerspoon to test window animations - see https://github.com/Hammerspoon/hammerspoon/issues/3035
x = hs.timer.doEvery(1,
function()
w = hs.console.hswindow()
if w then
w:move(
{
x=math.random(500),
y=math.random(500),
w=math.random(1000),
h=math.random(1000)
@luckman212
luckman212 / popper.lua
Last active January 31, 2022 05:42
quick popup note window for Hammerspoon
-- popper.lua
-- https://www.hammerspoon.org/docs/hs.webview.html
src=[[<html>
<head>
<style>
::-webkit-scrollbar {
background: #2d2e26;
width: 8px;
@luckman212
luckman212 / AerialLog.txt
Created January 18, 2022 12:48
Aerial 3.0.0 debug log
```
2022-01-17 15:59:40.948 : > Running under Aerial Companion!
2022-01-17 15:59:40.948 : avInit .saver (0.0, 0.0, 0.0, 0.0) p: true o: true
2022-01-17 15:59:40.948 : Running under companion in preview mode, preventing setup
2022-01-17 15:59:40.949 : PWC2 wdl: Aerial version Version 3.0.0
2022-01-17 15:59:40.964 : /PWC2 wdl
2022-01-17 15:59:40.965 : Creating app support directory...
2022-01-17 15:59:40.976 : tvOS 15 is not cached, downloading...
2022-01-17 15:59:40.988 : Parsed From Joshua Michaels & Hal Bergman
2022-01-17 15:59:40.989 : Sources loaded
@luckman212
luckman212 / airdropfix.sh
Created January 23, 2022 21:14
When Airdrop stops working, this might fix it without requiring a reboot...
#!/usr/bin/env bash
# requires blueutil: `brew install blueutil`
if ! sudo -v ; then
echo requires root
exit
fi
function dots() {

JavaScript (JXA)

The following applies to Alfred 4+. For Alfred 3, see below.

The equivalents to the above in JXA JavaScript (again, the exportable variable is optional):

Application('com.runningwithcrayons.Alfred').setConfiguration('browser', {
  toValue: 'Safari',
  inWorkflow: 'net.deanishe.demo',
 exportable: true
@luckman212
luckman212 / imessage-i-mean-what-i-type.sh
Last active October 13, 2022 05:00
Possible fix for iMessage text mangling
#!/usr/bin/env bash
# ref:
# https://forums.macrumors.com/threads/smart-quotes-forced-on-in-messages.2284346/post-30657259
_res() {
(( res += $1 ))
}
res=0