Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖
Arguing with computers.

Brett Buddin brettbuddin

🤖
Arguing with computers.
View GitHub Profile
View git-cut-branch
#!/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 Apr 13, 2020
Script to dump goroutine stack traces from Pods in Kubernetes.
View dump-pod-goroutines.sh
#!/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 Jun 4, 2019
Upsample via time domain.
View resample.go
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 Feb 4, 2019
EricaSynths Pico Drum Samples for Expert Sleepers Disting
View Gemfile
# 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 Sep 10, 2018
GopherCon 2018 Lightning Talk Patches for Shaden
View downtime.lisp
(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))
View encode.sh
shaden -backend=stdout -gain=-6 examples/krell.lisp | lame --replaygain-accurate -m s -r --preset standard --verbose - output.mp3
View keybase.md

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:

View save-current-wallcat.sh
#!/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
View gist:2966084
$ 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
View gist:2903136
go
› go install github.com/brettbuddin/victor/examples/bot
go
› bot -adapter campfire -name virbot
2012/06/09 19:45:23 Starting up...
2012/06/09 19:45:24 Fetched room info.
2012/06/09 19:45:24 Remembering: Brett Buddin
2012/06/09 19:45:24 Joined room.
2012/06/09 19:45:24 Listening...
2012/06/09 19:45:33 Listener /^(virbot[:,]?)\s*(?:(image|img) (.*))/ triggered by 'virbot img what'