Skip to content

Instantly share code, notes, and snippets.

@dy-dx
dy-dx / CoffeeScript.sublime-settings
Last active May 30, 2018 15:35
My custom Sublime Text 3 settings
{
"binDir": "/Users/chris/.nvm/current/bin/"
}
@dy-dx
dy-dx / shadowing.js
Created March 10, 2014 16:57
Inherited property shadowing in JavaScript
function Foobar () {
}
Foobar.prototype.foo = 1;
Foobar.prototype.bar = {qux: 1};
Foobar.prototype.baz = {qux: 1};
var a = new Foobar();
var b = new Foobar();
@dy-dx
dy-dx / .bash_profile
Last active June 15, 2021 14:06
My OSX .bash_profile
# shellcheck shell=bash
# shellcheck source=/dev/null
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.fzf.bash" ]] && source "$HOME/.fzf.bash"
export NVM_SYMLINK_CURRENT=true
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$HOME/.asdf/asdf.sh" ] && . "$HOME/.asdf/asdf.sh"
[ -s "$HOME/.asdf/completions/asdf.bash" ] && . "$HOME/.asdf/completions/asdf.bash"
@dy-dx
dy-dx / index.coffee
Created December 9, 2013 16:50
node.js script for listing closed + unmerged pull requests. Useful for tracking closed pull requests that may have been forgotten.
# Configuration
cfg =
oauth_token: ''
repo: 'viewthespace/viewthespace'
number_of_pulls: 40
timeout: 5000
unless cfg.oauth_token.length
return console.error """
Please generate an oauth token and place in cfg object.
@dy-dx
dy-dx / pre-commit
Last active January 21, 2016 23:31
Pre-commit hook that prevents debugging code and merge artifacts from being committed.
#!/bin/bash
# Pre-commit hook that prevents debugging code and merge artifacts from being committed.
FILES_PATTERN='\.(rb|erb|haml|js|coffee)(\..+)?$'
FORBIDDEN=( "binding\.pry" "save_and_open_page" "debugger" "it\.only" "describe\.only" ">>>>>>" "<<<<<<" "======" )
# the exit code from `grep -E $FILES_PATTERN` gets swallowed unless the pipefail option is set
set -o pipefail
@dy-dx
dy-dx / gource.sh
Created November 27, 2013 19:01
gource & ffmpeg settings
#!/bin/bash
gource \
--user-image-dir avatars/ \
--title "viewthespace" \
--highlight-users \
--user-scale 3 \
--auto-skip-seconds 0.01 \
--file-idle-time 0 \
--highlight-colour 00FF00 \