optimisit: for interpreting command line args
# 0 . Enter
bindkey -s "^[Op" "0"
bindkey -s "^[Ol" "."
bindkey -s "^[OM" "^M"
# 1 2 3
bindkey -s "^[Oq" "1"
bindkey -s "^[Or" "2"
bindkey -s "^[Os" "3"
# 4 5 6
This file contains hidden or 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 | |
# COLORS | |
red=$(tput setaf 1) | |
green=$(tput setaf 2) | |
yellow=$(tput setaf 3) | |
blue=$(tput setaf 4) | |
purple=$(tput setaf 5) | |
cyan=$(tput setaf 6) | |
white=$(tput setaf 7) |
This file contains hidden or 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
/** | |
* @jsx React.DOM | |
*/ | |
var React = require('react'); | |
var rebound = require('rebound'); | |
var Thumb = React.createClass({ | |
componentDidMount: function() { |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>React + D3</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> .arc path {stroke: #fff;} </style> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/0.8.0/react.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/0.8.0/JSXTransformer.js"></script> |
This file contains hidden or 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
" Indent automatically depending on filetype | |
filetype indent on | |
set autoindent | |
set smartindent | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
" Turn on line numbering. Turn it off with "set nonu" | |
set number |
This file contains hidden or 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script> | |
<script src="http://documentcloud.github.io/backbone/backbone-min.js"></script> |
This file contains hidden or 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
var drag = d3.behavior.drag() | |
.on("drag", function(d,i) { | |
d.x += d3.event.dx | |
d.y += d3.event.dy | |
d3.select(this).attr("transform", function(d,i){ | |
return "translate(" + [ d.x,d.y ] + ")" | |
}) | |
}); | |
This file contains hidden or 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
var svg = d3.select("div#myCanvas") | |
.append("svg") | |
.attr("width", 300) | |
.attr("height", 250) | |
.style("border", "1px solid #333"); | |
var createRects = function (data) { | |
var rect = svg.selectAll("rect").data(data); | |
rect.enter().append("rect") |
This file contains hidden or 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
var svg = d3.select("div#myCanvas") | |
.append("svg") | |
.attr("width", 300) | |
.attr("height", 300) | |
.style("background-color", "#333"); | |
var rect = svg.append("rect") | |
.attr("width", 50).attr("height",50).attr("x",20).attr("stroke", "#fff").attr("y",30).style("fill","red") | |
.transition().duration(3000).style("fill","blue").attr("x",100); |