Skip to content

Instantly share code, notes, and snippets.

View brettbuddin's full-sized avatar
🤖
Arguing with computers.

Brett Buddin brettbuddin

🤖
Arguing with computers.
View GitHub Profile
@brettbuddin
brettbuddin / tmux.conf
Created April 27, 2023 15:17
Stack-based windowing in tmux.
# Create new pane in current directory
bind -n M-c split-window -b -t :.0 -c "#{pane_current_path}" \;\
select-layout main-vertical \;\
run "tmux resize-pane -t :.0 -x 50%"
# Kill pane (only kill if we have more than one pane)
TMUX_SHOULD_KILL_PANE="tmux display-message -p '#{window_panes}' | awk '{exit(!($0>1))}'"
bind -n M-x if-shell "$TMUX_SHOULD_KILL_PANE" \
"kill-pane -t :." \;\
select-layout main-vertical \;\
#!/bin/bash
# Usage: git-cut-branch <name>
# Create a new branch named <name> pointed at HEAD and reset the current branch
# to the head of its tracking branch. This is useful when working on master and
# you realize you should be on a topic branch.
set -e
# bail out with message to stderr and exit status 1
die() {
echo "$(basename $0):" "$@" 1>&2
@brettbuddin
brettbuddin / dump-pod-goroutines.sh
Created April 13, 2020 15:28
Script to dump goroutine stack traces from Pods in Kubernetes.
#!/usr/bin/env zsh
if [ "$#" -ne 2 ]; then
echo "dump-pod-goroutines <labels> <port>"
exit 1
fi
labels="$1"
port="$2"
@brettbuddin
brettbuddin / resample.go
Created June 4, 2019 18:01
Upsample via time domain.
package fourier
import "errors"
func Upsample(in []float64, scale int) ([]float64, error) {
if scale < 1 {
return nil, errors.New("scale cannot be less than one")
}
var (
@brettbuddin
brettbuddin / Gemfile
Created February 4, 2019 18:13
EricaSynths Pico Drum Samples for Expert Sleepers Disting
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem 'msgpack'
gem 'wavefile'
@brettbuddin
brettbuddin / downtime.lisp
Last active September 10, 2018 15:13
GopherCon 2018 Lightning Talk Patches for Shaden
(define clock (unit/clock))
(define clock/div/2 (unit/clock-div (table :div 2)))
(define clock/div/4 (unit/clock-div (table :div 4)))
(define clock/div/8 (unit/clock-div (table :div 8)))
(define clock/div/16 (unit/clock-div (table :div 16)))
(define clock/mult/2 (unit/clock-mult (table :mult 2)))
(-> clock
(table :tempo (hz 3)
:shuffle 0))
shaden -backend=stdout -gain=-6 examples/krell.lisp | lame --replaygain-accurate -m s -r --preset standard --verbose - output.mp3

Keybase proof

I hereby claim:

  • I am brettbuddin on github.
  • I am brettbuddin (https://keybase.io/brettbuddin) on keybase.
  • I have a public key whose fingerprint is F1E8 3271 C98D 4FCA CD22 C8E6 D3C8 3DE6 20F2 C4CB

To claim this, I am signing this object:

#!/bin/bash -eu
WALLCAT_PATH=${WALLCAT_PATH:-$HOME/Pictures/Wallcat}
CURRENT_IMAGE=$(osascript -e 'tell app "finder" to get posix path of (get desktop picture as alias)')
CURRENT_IMAGE_FILENAME=$(basename $CURRENT_IMAGE)
mkdir -p $WALLCAT_PATH
cp $CURRENT_IMAGE $WALLCAT_PATH/$CURRENT_IMAGE_FILENAME
$ ssh root@192.168.15.244
$ mntroot rw
$ mkdir /mnt/us/screensaver
$ mount /dev/mmcblk0p1 /mnt/base-mmc
$ mv /mnt/base-mmc/opt/amazon/screen_saver/600x800 /mnt/base-mmc/opt/amazon/screen_saver/600x800.old
$ ln -sfn /mnt/us/screensaver /mnt/base-mmc/opt/amazon/screen_saver/600x800
$ mntroot ro
$ exit