Skip to content

Instantly share code, notes, and snippets.

idcrook /
Created March 6, 2022 20:41
quick and dirty copy files from a directory on a remote host python3 built-in
wget -r
idcrook / app_icon_model.scad
Last active July 1, 2020 18:29
Improved version of attempt at reverse engineering Xcode 12 Instruments icon, modeled in OpenSCAD
// Reverse-engineer model an Xcode 12 Instruments icon mesh in OpenSCAD
// Inspired to create by
// Turn on Animate in App menu bar
// [x] Check Dump Pictures
// - creates files in sequence frame00000.png
// - Select FPS: 12 and Steps: 60
idcrook /
Last active July 1, 2020 07:18
Recreate mesh of Instruments
#!/bin/bash -x
for j in `seq 0 144`;do
i=`printf "%04d" $j`
r=`expr 5 \* $j`
openscad -o logo_anim-$i.png app_icon_model.scad --preview --camera=0,0,0,90,0,$r,415 --colorscheme="Tomorrow Night" --projection=o
idcrook /
Last active May 7, 2019 18:49
macOS emacs emoji font settings
idcrook / lang-web.el
Created August 28, 2018 15:18
rsjx mode with attempt at auto-detecting JSX files
(use-package rjsx-mode
:mode "\\.jsx$"
:mode "components/.+\\.js$"
;; auto-detect JSX file
;; source:
(push (cons (lambda ()
(and buffer-file-name
(equal (file-name-extension buffer-file-name) "js")
# /etc/systemd/system/homebridge.service -*- systemd -*-
Description=Node.js HomeKit Server
ExecStart=/usr/local/bin/homebridge $HOMEBRIDGE_OPTS
idcrook / homebridge-camera-ffmpeg snippet config.json
Last active October 18, 2023 21:31
Configure homebridge-camera-ffmpeg homebridge plugin for USB-attached webcam
"platform": "Camera-ffmpeg",
"videoProcessor": "/usr/local/bin/ffmpeg",
"cameras": [
"name": "BasementCam",
"videoConfig": {
"source": "-re -f v4l2 -video_size 1280x720 -i /dev/video0",
"stillImageSource": "-f video4linux2 -input_format mjpeg -video_size 1280x720 -ss 0.9 -i /dev/video0 -frames:v 1",
"maxStreams": 2,
idcrook / magit-kill-buffers.el
Created June 13, 2018 16:12
Emacs magit-status kill associated buffers (instead of just burying)
;; based on
;; had to deviate from it since:
;; 1. the post's key bind code did not work for me
;; 2. added late loading, otherwise magit-status-mode-map undefined
;; 3. 'q' was already bound by magit, so use 'Q' instead of rebinding
(defun idc-magit-kill-buffers ()
"Restore window configuration and kill all (of these) Magit buffers."
(let ((buffers (magit-mode-get-buffers)))
idcrook /
Last active August 17, 2018 20:28
Shell command line expansion from kubernetes aliases; even complete in system namespace if bash alias uses that
# source kubectl bash completions
if hash kubectl 2>/dev/null; then
source <(kubectl completion bash)
# the magic via
# seems to require BASH 4; install bash from Homebrew and make its BASH 4 the default user shell in macOS
# mkdir ~/.bash_completion.d
# curl -o ~/.bash_completion.d/
if [ -f ~/.bash_completion.d/ ] ; then
idcrook / neotree-project-dir.el
Created June 13, 2018 15:06
emacs neotree and projectile: sync with projectile
;; NeoTree can be opened (toggled) at projectile project root
(defun neotree-project-dir ()
"Open NeoTree using the git root."
(let ((project-dir (projectile-project-root))
(file-name (buffer-file-name)))
(if project-dir
(if (neo-global--window-exists-p)