Skip to content

Instantly share code, notes, and snippets.


Chris F Ravenscroft Fusion

View GitHub Profile
Fusion / gist:d0a24928b5bab8e83486c4a96f652829
Created Nov 14, 2021
Check missing packages before migrating from Brew to Nix on MacOS
View gist:d0a24928b5bab8e83486c4a96f652829
# Note: this is a first pass. Some packages may be reported as missing due to their unorthodox naming; e.g. Python
brew update -q;nix-channel --update&>/dev/null;export T1=$(mktemp);T2=$(mktemp);brew list -1>$T1;nix-env -qaP|awk '{print $2}'>$T2;for pkg in $(cat $T1);do grep "^$pkg" $T2>/dev/null;[ $? -eq 0 ] || echo "Package $pkg not available.";done
Fusion / gist:9d666f49e5dd1a140c2916efd29cfa3d
Created Oct 3, 2021
Cycling Bluetooth off and off: workaround for capricious keyboard on Mac M1
View gist:9d666f49e5dd1a140c2916efd29cfa3d
tell application "System Preferences"
reveal pane id ""
tell application "System Events" to tell process "System Preferences"
display notification "Turning Bluetooth off and then back on." with title "Bluetooth" subtitle "Hopefully this fixes any keyboard issue." sound name "Frog"
click button "Turn Bluetooth Off" of window "Bluetooth" of application process "System Preferences" of application "System Events"
delay 5
click button "Turn Bluetooth On" of window "Bluetooth" of application process "System Preferences" of application "System Events"
end tell
Fusion / stitch.clj
Created Jul 13, 2020
Silly Python to Clojure test
View stitch.clj
(let [[jirafilepath tempofilepath mergedfilepath] *command-line-args*]
(when (or (empty? jirafilepath)
(empty? tempofilepath)
(empty? mergedfilepath))
"Please provide path to {jira export file} {temport export file} {merged file}")
(System/exit 1))
(with-open [reader (io/reader jirafilepath)]
(let [csv-data (csv/read-csv reader)]
Fusion / .pythonrc
Created Jul 3, 2020
Add history management to Python REPL #python
View .pythonrc
def history(numlines = -1):
import readline
total = readline.get_current_history_length()
if numlines == -1:
numlines = total
if numlines > 0:
for i in range(total - numlines + 1, total + 1):
print("%3d %s" % (i, readline.get_history_item(i)))
def bang(linenum = -1):
Fusion /
Created Jun 26, 2020
Installing nix in a container
# Setting up nix in a container.
# While build users are created, this is a stadanlone,
# no daemon required, install.
# nix is touchy that way.
groupadd -r nixbld
for n in $(seq 1 10); do
useradd -c "Nix build user $n" \
View blockstack
Verifying my Blockstack ID is secured with the address 16hJTdGrk2Re3THokXHXi4oJZj1TeNUeHk
Fusion / config.toml.tmpl
Created Sep 9, 2019
Importing hubot daily standups from Redis
View config.toml.tmpl
host = ""
port = 6379
password = "PASSWORD"
workbook = "Daily.xlsx"
Fusion / workspacer.config.csx
Created Sep 7, 2019
Dwindlw Fibonacci layout for Workspacer
View workspacer.config.csx
#r "C:\Program Files\workspacer\workspacer.Shared.dll"
#r "C:\Program Files\workspacer\plugins\workspacer.Bar\workspacer.Bar.dll"
#r "C:\Program Files\workspacer\plugins\workspacer.ActionMenu\workspacer.ActionMenu.dll"
#r "C:\Program Files\workspacer\plugins\workspacer.FocusIndicator\workspacer.FocusIndicator.dll"
using System;
using workspacer;
using workspacer.Bar;
using workspacer.ActionMenu;
using workspacer.FocusIndicator;
Fusion /
Last active Feb 13, 2021
Temporarily run a lightweight SSH server in a docker container

To run in a given container:

export C={container name} && curl | bash
Fusion / chrome-curl
Created Aug 31, 2018
A curl command that relies on chromium's full page rendering
View chrome-curl
while [[ $# -gt 0 ]]; do
case "$1" in
echo "Syntax: $0 [-o <file name>][-O] URL"
exit 0