Skip to content

Instantly share code, notes, and snippets.

@scottcheng
scottcheng / .gitconfig
Created October 5, 2015 01:11
.gitconfig
[user]
name = Scott Cheng
email = me@scottcheng.com
[color]
ui = true
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
@scottcheng
scottcheng / .bash_profile
Created October 5, 2015 01:10
.bash_profile
export PATH=\
"/usr/local/bin:"\
"/usr/local/heroku/bin:"\
"/usr/local/share/npm/bin:"\
"$HOME/Library/Haskell/bin:"\
"$HOME/.rvm/bin:"\
"/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin:"\
"$PATH"
# define colors
@scottcheng
scottcheng / OSX.sublime-keymap
Last active March 16, 2023 18:29
Vim-style navigation key mapping for Sublime Text
[
{ "keys": ["ctrl+k"], "command": "move", "args": { "by": "lines", "forward": false } },
{ "keys": ["ctrl+j"], "command": "move", "args": { "by": "lines", "forward": true } },
{ "keys": ["ctrl+l"], "command": "move", "args": { "by": "characters", "forward": true } },
{ "keys": ["ctrl+h"], "command": "move", "args": { "by": "characters", "forward": false } },
{ "keys": ["ctrl+shift+k"], "command": "move", "args": { "by": "lines", "forward": false, "extend": true } },
{ "keys": ["ctrl+shift+j"], "command": "move", "args": { "by": "lines", "forward": true, "extend": true } },
{ "keys": ["ctrl+shift+l"], "command": "move", "args": { "by": "characters", "forward": true, "extend": true } },
{ "keys": ["ctrl+shift+h"], "command": "move", "args": { "by": "characters", "forward": false, "extend": true } },
@scottcheng
scottcheng / d3.min.js
Last active December 17, 2015 04:58
D3 scale.quantize.invertExtent() example
d3=function(){function n(n){return null!=n&&!isNaN(n)}function t(n){return n.length}function e(n){for(var t=1;n*t%1;)t*=10;return t}function r(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function u(){}function i(){}function a(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function o(){}function c(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new u;return t.on=function(t,u){var i,a=r.get(t);return arguments.length<2?a&&a.on:(a&&(a.on=null,e=e.slice(0,i=e.indexOf(a)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function l(){ca.event.stopPropagation(),ca.event.preventDefault()}function f(){for(var n,t=ca.event;n=t.sourceEvent;)t=n;return t}function s(n,t){function e(){n.on(t,null)}n.on(t,function(){l(),e()},!0),setTimeout(e,0)}function h(n){for(var t=new o,e=0,r=arguments.length;++e<r;)t[arguments[e]]=c(t);return t.of=function(e,r){return