Skip to content

Instantly share code, notes, and snippets.

View reiddraper's full-sized avatar
🍹

Reid Draper reiddraper

🍹
View GitHub Profile
@reiddraper
reiddraper / app.config
Created April 2, 2011 22:59
erlang.log.1
[
{kernel, [
{inet_dist_listen_max, 7999},
{inet_dist_listen_min, 6000}
]},
{riak_kv, [
{stats_urlpath, "stats"},
{pb_ip, "0.0.0.0"},
{mapred_queue_dir, "/var/lib/riak/mr_queue"},
{mapred_name, "mapred"},
@reiddraper
reiddraper / gist:950847
Created May 1, 2011 20:35
prolog cocktails
any([X|Y], R) :- member(X, R).
any([X|Y], R) :- any(Y, R).
all([X|Y], R):- member(X, R), all(Y,R).
all([], _).
cocktail(martini).
cocktail(martinez).
cocktail(manhattan).
cocktail(ginmule).
@reiddraper
reiddraper / gist:960961
Created May 7, 2011 23:31
echo nest rdio js playback
var myNest = nest.nest("YOURAPIKEY");
var songs = myNest.searchSongs({artist:"beck",
title: 'lost cause',
bucket: ['id:rdio-us-streaming'],
limit: 'true'
}, function (err, results) {
var id = results[0].foreign_ids[0].foreign_id.split(':').pop();
apiswf.rdio_play(id);
});
80 grams (about 1 cup whole beans) coffee
2 cups room temperature water
Makes about 3 iced-coffee
Grind beans coarsely, I used one setting below the coarsest. Mix water and coffee into a container, cover, and let sit for 10 hours.
After, filter the brewed coffee as best you can. The result will be strong, too strong to drink. I suggest diluting with 0.5:1.0 water to brew.
Pour over ice, or, heat.

Some header

  1. point one

     cd src
     make
    
  2. point two

run these commands

take 10 [ x | x <- [1..], x `mod` 5 == 0]
import time
try:
time.sleep(1000 ** 2)
except Exception, e:
print 'caught it'
except:
print "it didn't catch KeyboardInterrupt"
isPalindrome :: (Eq a) => [a] -> Bool
isPalindrome [] = True
isPalindrome [x] = True
isPalindrome (x:xs) = (x == last xs) && (isPalindrome $ init xs)
#!/usr/bin/env python
import logging
logger = logging.getLogger()
def main():
logger.info('hello world!')
if __name__ == '__main__':