This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var modes = ['Ionian', 'Dorian', 'Phrygian', 'Lydian', 'Mixolydian', 'Aeolian', 'Locrian']; | |
var steps = [2, 2, 1, 2, 2, 2, 1]; | |
var notes = ['C', 'C#/Db', 'D', 'D#/Eb', 'E', 'F', 'F#/Gb', 'G', 'G#/Ab', 'A', 'A#/Bb', 'B']; | |
var noteRoots = ['C', 'D', 'E', 'F', 'G', 'A', 'B']; | |
function getNotes(scale, mode) { | |
if(mode === 'Major') { | |
mode = 'Ionian'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
usage() { | |
cat <<'HELP' | |
v [OPTIONS] [FILES] | |
create a new vim server or interact with an existing one | |
-h show this help | |
-d disable focusing on vim | |
-s associate tmux pane in vim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var gulp = require("gulp"), | |
sourcemaps = require("gulp-sourcemaps"), | |
babel = require("gulp-babel"), | |
concat = require("gulp-concat"), | |
uglify = require("gulp-uglify"), | |
rename = require("gulp-rename"), | |
del = require("del"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
usage() { | |
cat <<'HELP' | |
-s string to search | |
-t list only text files | |
-c command to execute [defaults to vim] | |
HELP | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! PromptQuit() | |
echo 'close current buffer?' | |
if nr2char(getchar())=~'y' | |
silent execute "normal \<esc>:Sayonara!\<cr>" | |
elseif nr2char(getchar())=~'Y' | |
silent execute "normal \<esc>:Sayonara\<cr>" | |
endif | |
silent! redraw! | |
endfunction | |
nnoremap <silent> Q <Esc>:call PromptQuit()<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
has() { | |
command -v $1 &> /dev/null | |
} | |
err() { | |
echo -e "\e[31m$1\e[0m" >&2 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
declare file="$(date +%F-%s).webm" | |
declare window=false | |
declare region=false | |
declare duration | |
declare delay=0 | |
declare verbose | |
declare -A dimensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
'use strict'; | |
const range = function(start, stop) { | |
return Array.apply(null, { length: 1 + stop - start }) | |
.map((v, i) => start + i); | |
}; | |
const collatz = function(n, len) { | |
let steps = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
declare esc=$(printf '\033') | |
declare c_reset="${esc}[0m" | |
declare c_red="${esc}[31m" | |
declare c_green="${esc}[32m" | |
declare c_blue="${esc}[34m" | |
err() { | |
echo -e "${c_red}$@${c_reset}" >&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
'use strict'; | |
const runlength = {}; | |
runlength.decode = function(str) { | |
return str.match(/\d*\w/g) | |
.reduce((prev, curr) => | |
prev + (curr.length > 1 | |
? curr.slice(-1) |