This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var rest = require('restler'); | |
rest.get('http://github.com/api/v2/json/repos/watched/{username}').on('complete', function(data) { | |
data.repositories.forEach(function(repo){ | |
console.log(repo.owner + "/"+ repo.name + " , " + repo.description + " , " + repo.language); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys= require('sys'); | |
var OAuth= require('oauth').OAuth; | |
var TwitterNode = require('twitter-node').TwitterNode; | |
var consumer_key = "-"; | |
var consume_secret = "-"; | |
var access_token = "-"; | |
var access_token_secret = "-"; | |
//var oa= new OAuth("https://api.twitter.com/oauth/request_token","https://api.twitter.com/oauth/access_token", consumer_key, consume_secret, "1.0A", "http://localhost:3000/oauth/callback", "HMAC-SHA1"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env coffee | |
sys = require 'sys' | |
fs = require 'fs' | |
http = require 'http' | |
tovisit = [] | |
imgcount = 0 | |
getImage= (url)-> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#analytics stuff | |
_gaq = [['_setAccount','UA-XX-1'],['_trackPageview']] | |
d = window.document | |
l = d.location | |
scripts = [ | |
'//google-analytics.com/ga.js', | |
'//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js', | |
'//' + l.host + '/js/site.js' | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#analytics stuff | |
_gaq = [['_setAccount','UA-18606719-1'],['_trackPageview']] | |
d = window.document | |
l = d.location | |
scripts = [ | |
'google-analytics.com/ga.js', | |
'ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js', | |
l.host + '/js/site.js' | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Db = require('mongodb').Db; | |
var Server = require('mongodb').Server; | |
var Connection = require('mongodb').Connection; | |
var host = process.env['MONGO_NODE_DRIVER_HOST'] != null ? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost'; | |
var port = process.env['MONGO_NODE_DRIVER_PORT'] != null ? process.env['MONGO_NODE_DRIVER_PORT'] : Connection.DEFAULT_PORT; | |
var nativeparser = new Db('testing', new Server(host, port, {}), {native_parser:true}); | |
var jsparser = new Db('testing', new Server(host, port, {})); | |
var Foo = function(){ | |
this.foo = "foo"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
Takes a GitHub service hook POST and automatically updates the associated repo. | |
''' | |
__license__ = ''' | |
Copyright 2009 Jake Wharton | |
hookpuller is free software: you can redistribute it and/or modify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.defineProperty(Object.prototype, "extend", | |
enumerable: false | |
value: (from)-> | |
props = Object.getOwnPropertyNames(from) | |
dest = this | |
props.forEach((name)-> | |
if (name in dest) | |
destination = Object.getOwnPropertyDescriptor(from, name) | |
Object.defineProperty(dest, name, destination) | |
return this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require("sys"); | |
var fs = require('fs'); | |
var Db = require('mongodb').Db; | |
var Connection = require('mongodb').Connection; | |
var Server = require('mongodb').Server; | |
var BSON = require('mongodb').BSONNative; | |
var _ = require('nimble'); | |
var host = process.env['MONGO_NODE_DRIVER_HOST'] != null ? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost'; | |
var port = process.env['MONGO_NODE_DRIVER_PORT'] != null ? process.env['MONGO_NODE_DRIVER_PORT'] : Connection.DEFAULT_PORT; |
OlderNewer