Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View zackintosh's full-sized avatar

Zack Smith zackintosh

  • Boulder, CO
View GitHub Profile
@zackintosh
zackintosh / basic-quantized-drum-beat.rb
Last active February 6, 2021 12:40
Sonic Pi: Basic Quantized Drum Beat
# Sonic Pi (http://sonic-pi.net/)
# Basic Quantized Drum Beat
# Globals
$bpm = 128
$bps = $bpm / 60
$qunatize = 1.0 / 32.0
# Helper step sequencing method
def sync_steps(steps, quantize = 1.0 / 4.0)
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
@zackintosh
zackintosh / brew-fix-taps.sh
Last active December 18, 2015 21:59
Fixes homebrew's taps when they are reported as broken when running "brew doctor" (eg. "Error: Failed to import: bonjour-browser"). This seems to happen often when the cask (https://github.com/phinze/homebrew-cask) tap has been tapped.
#/usr/bin/env bash
# Fix homebrew taps and simlinks
brewDir=$(brew --prefix)
taps=($(brew tap)) #Save off the current taps into an array
# Untap everything
for i in "${taps[@]}"
do
printf "Untapping: $i\n"
@zackintosh
zackintosh / run_quil_examples.clj
Last active December 15, 2015 05:39
Load and run the gen_art examples from the Quil Project (https://github.com/quil/quil)
; In the base quil folder
; lein deps
; lein compile
; lein repl
(def files (map clojure.java.io/as-relative-path (rest (file-seq (java.io.File. "./examples/gen_art"))))) ; Get all the gen_art examples
(def files ((fn [x] (println (first x)) (load-file (first x)) (rest x)) files)) ; Load and run the next example
@zackintosh
zackintosh / SimpleHTTPServer.sh
Created July 27, 2012 20:48
Simple Python HTTPServer
function server() {
local port="${1:-8000}"
open "http://localhost:${port}/"
python -m SimpleHTTPServer "$port"
}