Skip to content

Instantly share code, notes, and snippets.

View deedubs's full-sized avatar
:shipit:
kustomize build all-the-things | kubectl apply -f -

Dan Williams deedubs

:shipit:
kustomize build all-the-things | kubectl apply -f -
View GitHub Profile
@deedubs
deedubs / gist:1391826
Created November 24, 2011 17:09
signup flow
diagram {
signup -> email -> clickConfirm -> activate -> dashboard
lane user {
signup [label = "Signup for service"];
clickConfirm [label = "Click confirm link"];
}
lane application {
email [label = "Send activation email"];
@deedubs
deedubs / demo.json
Created November 25, 2011 00:57
Pegjs for parsing JSON with RegEx in it.
{
"name" : /Dan/
}
@deedubs
deedubs / heroku.bash
Created November 25, 2011 18:50
heroku open time
time heroku open
Opening http://...herokuapp.com/
real 0m8.357s
user 0m3.502s
sys 0m0.467s
var mongoose = require('mongoose')
, Schema = mongoose.Schema
, ObjectId = Schema.ObjectId;
var QuestSchema = new Schema({
name: String
, loc: {
lng: Number
, lat: Number
}
Hank:~ deedubs$ npm info
Error: npm doesn't work with node v0.4.7
Required: [email protected] || 0.7 || 0.8
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:60:23
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:80:2)
at Module._compile (module.js:404:26)
at Object..js (module.js:410:10)
at Module.load (module.js:336:31)
at Function._load (module.js:297:12)
at Array.0 (module.js:423:10)
@deedubs
deedubs / middleware.js
Created January 10, 2012 00:45
Access Express Server Object from Middleware
....
var myplugin = express.createServer()
, ready = false;
myplugin.get('/:verb/allthe/:nouns', function(req, res) {
if(ready) {
console.log(myplugin.app); // here too
@deedubs
deedubs / index.js
Created January 19, 2012 19:04 — forked from shiawuen/index.js
var userSchema = new Schema({
email: String
, passwordHash: String
});
userSchema.pre('validate', function(next) {
if (this.password === this.passwordConfirm) {
this.set('passwordHash', hash(this.password);
this.set('passwordHash',undefined);
@deedubs
deedubs / gist:1846218
Created February 16, 2012 16:26
Hook.io Install failed
sudo npm -g i hook.io
npm http GET https://registry.npmjs.org/hook.io
npm http 304 https://registry.npmjs.org/hook.io
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/eventemitter2
npm http GET https://registry.npmjs.org/nconf
npm http GET https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/mkdirp
@deedubs
deedubs / Fixed.
Created February 21, 2012 18:20
Post Ban
app.post('/user/ban/:userId', function(req, res){
req.user.bannedReason = req.body.bannedReason;
req.user.banned = true;
console.log(req.user.id)
req.user.save(function(err) {
if (err) {
req.flash('info','User banned:' + req.body.bannedReason);
} else {
req.flash('info','User cannot be banned');
}
@deedubs
deedubs / gist:1901092
Created February 24, 2012 13:58
LOL @ Recruiters
Hi Dan,
I sent you a note three months ago about a role at Skype and I did not hear from you. I
The javascript/backbone.js team is expanding and I'd you to considering working with Skype.
Based on your background, you would perform in the job very well and you will absolutely love the office and people. I am excited to be representing this team and if you meet them, you'll understand why.
As an added bonus, there's a chance they won't find you irritating or boring.
Send me a note, let's get you to Palo Alto.
-T