- Optimist - Light-weight option parsing for node.js
- http-server - a simple zero-configuration command-line http server
- prompt - A beautiful command-line prompt for node.js
- git - javascript git implementation
- vows & assert(core) - for writing unit tests
- everyauth - node.js auth package (password, facebook, & more) for Connect and Express apps
- rocket - The rapid development framework for node.js/couchDB/mongoDB web apps
This file contains hidden or 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
| function getSafe (self, uuid) { | |
| if (typeof self === 'object' || typeof self === 'function') var safe = {} | |
| if (Array.isArray(self)) var safe = [] | |
| var recurse = [] | |
| Object.defineProperty(self, uuid, {}) | |
| var attrs = Object.keys(self).filter(function (i) { | |
| if (i === uuid) return false |
This file contains hidden or 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 ruby | |
| search_term = ARGV[0] | |
| if search_term | |
| time = Time.now | |
| directory_path = File.dirname(__FILE__) + "/tweets/" + search_term + "_" + time.to_i.to_s | |
| Dir.mkdir_p(directory_path) | |
| directory = Dir.new(directory_path) | |
| (1..15).each do |i| | |
| `curl "http://search.twitter.com/search.json?q=#{search_term}&rpp=100&page=#{i}&include_entities=true&result_type=mixed" > #{directory.path}/#{i}.json` | |
| end |
This file contains hidden or 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
| { | |
| "Christopher de Beer": { | |
| "Location": "Edinburgh, UK", | |
| "Job" : { | |
| "Company": "Amazon.com", | |
| "Roles": [ | |
| "Web Develeopment Engineer" | |
| ], | |
| }, | |
| "Social": { |
This file contains hidden or 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 testJSON = { | |
| div: { | |
| attributes: { | |
| class: ["wrapper"], | |
| id: "wrapper", | |
| }, | |
| innerHTML: { | |
| h1: { | |
| attributes: { |
This file contains hidden or 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
| (function(){ | |
| $("a[href^='user?id']").each(function(i,e){ | |
| var username = $(e).text(); | |
| $.get("/user?id=" + username, function(data){ | |
| //console.log(data); | |
| var twitternames = data.match(/(?:twitter\.com\/([a-zAZ0-9]+))|(?:[^a-z,^A-Z,^0-9]@([a-z,A-z,-9]+))/gi); | |
| if (twitternames) { | |
| $.each(twitternames,function(i,e) { | |
| twitternames[i] = twitternames[i].replace(/[^a-zA-Z0-9]+@([a-zA-Z0-9]+)/gi,"@$1"); | |
| twitternames[i] = twitternames[i].replace(/twitter\.com\//gi,"@"); |
This file contains hidden or 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
| app.get('/', function(req, res){ | |
| var ua = req.header('user-agent'); | |
| if(/mobile/i.test(ua)) { | |
| res.render('mobile.html'); | |
| } else { | |
| res.render('desktop.html'); | |
| } | |
| }); |
This file contains hidden or 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
| function loadScript(url, callback){ | |
| var script = document.createElement("script") | |
| script.type = "text/javascript"; | |
| if (script.readyState){ //IE | |
| script.onreadystatechange = function(){ | |
| if (script.readyState == "loaded" || | |
| script.readyState == "complete"){ | |
| script.onreadystatechange = null; |
This file contains hidden or 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 a=document.getElementsByTagName('head')[0],b=document.createElement('script'); | |
| b.type='text/javascript'; | |
| b.src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?'+Math.floor(Math.random()*99999); | |
| a.appendChild(b); | |
| var c=document.getElementsByTagName('head')[0],d=document.createElement('script'); | |
| d.type='text/javascript'; | |
| d.src='https://raw.github.com/gist/1141739/b5ae48df4eb615f0d523836c6d140f8660f2d450/jquery.raptorize.1.0.js?'+Math.floor(Math.random()*99999); | |
| c.appendChild(d); |
This file contains hidden or 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
| /* | |
| * jQuery Raptorize Plugin 1.0 | |
| * www.ZURB.com/playground | |
| * Copyright 2010, ZURB | |
| * Free to use under the MIT license. | |
| * http://www.opensource.org/licenses/mit-license.php | |
| */ | |
| (function($) { |