Skip to content

Instantly share code, notes, and snippets.

@mnem
mnem / fibonacci_limits.c
Created February 23, 2014 01:08
Quick and dirty calculator for the largest fibonacci sequence number which can be held in common integer widths and in a JavaScript Number. Likely only compiles on a 64 bit machine with a reasonably modern gcc or clang.
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
// Uses the fibonacci sequence defined
// in http://oeis.org/A000045
__uint128_t fib(__uint128_t n) {
if (n == 0) {
return 0;
@kbaird
kbaird / git_binary_diff_gist
Created May 10, 2012 16:01
Binary diff setup in .git/config
[diff "bz2"]
binary = true
textconv = /bin/bzcat
[diff "gzip"]
binary = true
textconv = /bin/zcat
[diff "tar"]
binary = true
textconv = tar --to-stdout -xf
[diff "tar-bz2"]
@matschaffer
matschaffer / gist:942981
Created April 26, 2011 19:52 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
$ git branch -r --merged |
sed '/>|master/d;/origin/!d;s:origin/::' |
xargs git push origin --delete
# I think this will work, but I don't know how to get git branch to show me that -> line