Watch the demo at bl.ocks.org.
Source and comments on gist.github.com.
Watch the demo at bl.ocks.org.
Source and comments on gist.github.com.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
"use strict"; |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Thiemo Mättig <http://maettig.com/> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
// Item: Unit price Special Price | |
// it should return the price for a single item | |
// it shold fail it item does not exist | |
// it should sum up all prices | |
// it should apply special price (3 for 130) for A | |
// it should apply special price (2 for 45) for B | |
describe('cart should accept products', () => { | |
let cart; |
cp -R -f ./sourcedir/* ./targetdir/ |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} | |
PS1='\[\e[0;36m\]\h: \e[0;32m\]\W\e[0;35m\]$(parse_git_branch)\[\e[m\] $ ' |
git log --graph --pretty=oneline --abbrev-commit |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} | |
PS1='\[\e[0;36m\]\h: \e[0;32m\]\W\e[0;35m\]$(parse_git_branch)\[\e[m\] $ ' |
Experiments in revision control: Curry recipe. | |
My personal recipe for Japanese curry, which has mutated over the years and is | |
now open-source thanks to github, hot damn. Some of the ingredients are not | |
very Japanese, but curry came to Japan from England which got it from India to | |
begin with, so whatever. | |
1.5 - 2 lbs. of meat, prefer thin-sliced beef (komagire), pork works, too. | |
Thin-sliced stuff is always best, but in a pinch stewing beef works. Bacon | |
works surprisingly well. Chicken will work, technically, but if you must, |
function bubbleSort(array, onComplete){ | |
var pos = 0; | |
(function(){ | |
var j, value; | |
for (j=array.length; j > pos; j--){ | |
if (array[j] < array[j-1]){ | |
value = data[j]; |