Skip to content

Instantly share code, notes, and snippets.

View aemkei's full-sized avatar

Martin Kleppe aemkei

View GitHub Profile
@aemkei
aemkei / Readme.md
Last active August 29, 2015 14:12
A Snow Animation in 90 Bytes of HTML and JavaScript
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
"use strict";
@aemkei
aemkei / LICENSE.txt
Last active August 29, 2015 14:23 — forked from maettig/LICENSE.txt
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
@aemkei
aemkei / tdd-bin.js
Last active August 29, 2015 14:23
TDD Bin
// 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\] $ '
@aemkei
aemkei / gist:58756
Created February 5, 2009 15:37 — forked from pete/gist:57898
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];