I hereby claim:
- I am troygoode on github.
- I am troy (https://keybase.io/troy) on keybase.
- I have a public key whose fingerprint is 8917 81AC B1F8 0B7F 226B 8166 EA68 7C56 17DD 1FC0
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
fillSkinPixels = (imagePath, regions) -> | |
Promise.cast() | |
.then -> | |
filepath.Abs imagePath | |
.then (path) -> | |
nude.DecodeImage path | |
.then (img) -> | |
Promise.cast() | |
.then -> | |
image.NewRGBA img.Bounds() |
# withing the `mongo` REPL: | |
use benjy | |
db.tx_logs.insert({campaign: 'foo', medium: 'tv', timestamp: new Date(), some_value: 1}) | |
db.tx_logs.insert({campaign: 'foo', medium: 'tv', timestamp: new Date(), some_value: 2}) | |
show collections |
var source = { | |
first: 'Barack', | |
last: 'Obama', | |
job: { | |
title: 'POTUS', | |
annualSalary: 400000 | |
} | |
}; | |
var schema = { |
format: function (attrs) { | |
var retval = _.clone(attrs); | |
retval.stages = JSON.stringify(retval.stages); | |
return retval; | |
} |
var http = require('http'); | |
http.createServer(function (req, res) { | |
var requestId = Math.floor(Math.random() * 1000); | |
console.log('Request ID ' + requestId + ' received'); | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World from Request ID ' + requestId + '\n'); | |
console.log('Request ID ' + requestId + ' responded'); |
# Description: | |
# Retrieves random quote from developerexecuses.com | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: |
rabbitmq = require 'rabbitmq' | |
queue = rabbitmq.queue 'queue://oberon/new-qgam-profile' | |
module.exports = (app) -> | |
app.post '/api/new-qgam-profile', (req, res) -> | |
message_json = req.body # assumed to look something like {customer_key: 'A', profile_id: 'B'} | |
queue.push message_json, (err) -> | |
#TODO: error handling |
web: node server.js |
var basicAuthUnlessCookie = function(req, res, next){ | |
if(/* check for cookie here */){ | |
//TODO: do something with the cookie | |
next(); | |
}else{ | |
express.basicAuth(function(user, pass){ | |
return true; //TODO: implement | |
})(req, res, next); | |
} | |
}); |