Skip to content

Instantly share code, notes, and snippets.

View ryantenney's full-sized avatar

Ryan Tenney ryantenney

View GitHub Profile
"""
I've been thinking lately about how perfect Redis would be for storing a
simple social graph. I posited that it would be relatively few lines of code,
and that it'd be clean code too. So here it is: a basic social graph built on Redis.
"""
class FriendGraph(object):
def __init__(self, ring):
self.ring = ring
/* The world's smallest Brainfuck interpreter in C, by Kang Seonghoon
* http://j.mearie.org/post/1181041789/brainfuck-interpreter-in-2-lines-of-c */
s[99],*r=s,*d,c;main(a,b){char*v=1[d=b];for(;c=*v++%93;)for(b=c&2,b=c%7?a&&(c&17
?c&1?(*r+=b-1):(r+=b-1):syscall(4-!b,b,r,1),0):v;b&&c|a**r;v=d)main(!c,&a);d=v;}
@omarkj
omarkj / _formatting.js
Created November 9, 2010 14:55
Underscore.js mixin that provides a 'printf'-like functionality
_.mixin({
format: function(string) {
var i = 1, a, f = string, o = [], m, p, c, x, s = '';
while (f) {
if (m = /^[^\x25]+/.exec(f)) {
o.push(m[0]);
}
else if (m = /^\x25{2}/.exec(f)) {
o.push('%');
}
#!/usr/bin/env node
// requires node v0.3
// telnet.js 80 google.com
net = require('net');
a = process.argv.slice(2);
if (!a.length) {
console.error("telnet.js port [ host=localhost ]");
process.exit(1);
}
s = require('net').Stream();
@davglass
davglass / gist:749325
Created December 21, 2010 01:13
Setting up ssh keys and ssh-agent on ChromeOS in developer mode
## Developer Mode must be enabled..
## Hit "Ctrl + Atl + Right Arrow" (Right arrow is where F2 should be)
## Login with chronos
qemacs .profile
##Add this to your .profile
@lenary
lenary / gitconfig.ini
Created February 18, 2011 01:21
a special excerpt of my gitconfig
$ git clone github:lenary/guides.git
Cloning into guides...
remote: Counting objects: 255, done.
remote: Compressing objects: 100% (216/216), done.
remote: Total 255 (delta 111), reused 163 (delta 35)
Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done.
Resolving deltas: 100% (111/111), done.
$ cd guides
$ git remote -v
anonymous
anonymous / db.go
Created January 24, 2012 17:39
Go SDK for Dropbox
package dropbox
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"strconv"

Adrian -

I appreciate that you spent time in writing this post. I know I've been up until 2am writing similarly long ones as well. I will take responsibility for having what is likely an irrational response (I blame Twitter for that) to the term "NoOps", but I invite you to investigate why that might be. I'm certainly not the only one who feels this way, apparently, and thus far have decided this issue is easily the largest distraction in my field I've encountered in recent years. I have had the option to simply ignore my opposition to the term, and just let the chips fall where they may with how popular the term "NoOps" may or may not get. I have obviously not taken that option in the past, but I plan to in the future.

You're not an analyst saying "NoOps". Analysts are easy (for me) to ignore, because they're not practitioners. We have expectations of engineering maturity from practitioners in this field of web engineering, especially those we consider leaders. I don't have any expectations from analysts,

@ryantenney
ryantenney / gist:3582019
Created September 1, 2012 18:08
White House Beer Recipes

White House Beer Recipes

White House Honey Porter

Ingredients

  • 2 (3.3 lb) cans light unhopped malt extract
  • 3/4 lb Munich Malt (cracked)
  • 1 lb crystal 20 malt (cracked)
  • 6 oz black malt (cracked)
@ryantenney
ryantenney / gist:3593429
Created September 2, 2012 01:33 — forked from ryantenney/gist:3582019
White House Beer Recipes