Skip to content

Instantly share code, notes, and snippets.

Martin Kleppe aemkei

Block or report user

Report or block aemkei

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Remove DS_Store files
find . -name *.DS_Store -type f -exec rm {} \;
find . -name ".svn" -exec rm -rf {} \;
View Count Your Commits
git shortlog -s -n
135 Tom Preston-Werner
15 Jack Danger Canty
10 Chris Van Pelt
7 Mark Reid
6 remi
3 Mikael Lind
3 Toby DiPasquale
2 Aristotle Pagaltzis
View text-based graph
git log --graph --pretty=oneline --abbrev-commit
View Git Status in Promt
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\] $ '
View Git Status in Promt
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\] $ '
View gist:58756
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,
View bubblesort.js
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];
View memorizer.js
function memoizer(memo, fundamental) {
var shell = function (n) {
var result = memo[n];
if (typeof result !== 'number') {
result = fundamental(shell, n);
memo[n] = result;
}
return result;
};
return shell;
View schedule.js
function schedule(functions, context){
setTimeout(function(){
var process = functions.shift();
process.call(context);
if (functions.length > 0){
setTimeout(arguments.callee, 100);
}
}, 100);
You can’t perform that action at this time.