A line graph with a projected future that waves to indicate uncertainty in the projection.
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
#!/bin/bash | |
if [[ -n "$TMUX" ]]; then | |
tmux send "git diff --cached" C-m \; split-window -v \; send "git commit $* && exit" C-m | |
else | |
git commit $* | |
fi |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"os" | |
"strings" | |
) |
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
http = require 'http' | |
createLongPollingServer = (interval, {getData, returnData}) -> | |
http.createServer (request, response) -> | |
poll = -> | |
data = getData request | |
return setTimeout poll, interval if not data | |
response.writeHead 200, 'Content-Type': 'text/plain' |
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
type Request struct {} |
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
from contextlib import contextmanager | |
@contextmanager | |
def assert_change_by(fn, delta): | |
original = fn() | |
yield | |
final = fn() | |
assert final - original == delta | |
Demonstrates the D3 ray-label plugin for labeling slices of pie and donut graphs based on the angle of each slice's centroid.
Label font sizes are scaled (within bounds) based on the size of the slice.
Plugin is hosted on Github.
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
background: #fcfcfa; | |
} | |
.stroke { | |
fill: none; |
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
import json | |
import sys | |
for p in json.load(sys.stdin): | |
if p['head']['ref'] == sys.argv[1]: | |
print p['html_url'] |
A shell script to give step-by-step instructions. Pipe text into it. It'll be processed as follows:
- Each line is echoed back to you one at a time.
- Hit the Enter key to see the next instruction.
- Lines surrounded by triple backticks are copied to the system clipboard, and the next line of text has the icon
↪
next to it. - Blank lines are ignored.
- To insert a blank line, use a triple dash (
---
).
OlderNewer