Skip to content

Instantly share code, notes, and snippets.

@micahwedemeyer
Created November 5, 2011 15:46
Show Gist options
  • Save micahwedemeyer/1341684 to your computer and use it in GitHub Desktop.
Save micahwedemeyer/1341684 to your computer and use it in GitHub Desktop.
problem
createInsult = (cb, res) ->
redis = require('redis')
redisUrl = process.env.REDISTOGO_URL || "redis://127.0.0.1:6379/"
redisClient = require('redis-url').connect(redisUrl)
redisClient.srandmember "adjectives", (err, adj) ->
redisClient.srandmember "nouns", (err, noun) ->
redisClient.srandmember "verbs", (err, verb) ->
insult = "is a " + adj + " " + noun + " " verb
cb(insult, res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment