Published as a proper npm module!
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title> | |
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(function () { | |
var extractToken = function(hash) { |
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
h1 { | |
font-size: 1.5em; | |
font-weight: bold; | |
margin: 1em 0; | |
} | |
h2 { | |
font-size: 1.25em; | |
margin: 1em 0; | |
} |
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
# synchronously creates the directory at the given path, including all | |
# intermediate directories, if it doesn't already exist. (like `mkdir -p`) | |
mkdirpSync = (dir) -> | |
# normalize and resolve path to an absolute one: | |
# (path.resolve automatically uses the current directory if needed) | |
dir = path.resolve path.normalize dir | |
# try to create this directory: | |
try |
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
// app-dev.js | |
// Helper script to register CoffeeScript and Streamline extension handlers | |
// before running an app during development. | |
// | |
// Uses https://github.com/aseemk/coffee-streamline for efficient require(), | |
// caching compiled files between runs. Sweet! | |
// | |
// Usage: instead of `_coffee app`, just do `node app-dev app`. | |
// | |
// Also works great w/ node-dev <https://github.com/fgnass/node-dev>: |
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
{ | |
"adjacencies": { | |
"node/1": { | |
"node/2": "rel/1", | |
"node/3": "rel/2" | |
}, | |
"node/2": { | |
"node/4": "rel/3" | |
}, | |
"node/3": { |
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 express = require('express') | |
, cookieSessions = require('./cookie-sessions'); | |
var app = express(); | |
app.use(express.cookieParser('manny is cool')); | |
app.use(cookieSessions('sid')); | |
app.get('/', function(req, res){ | |
req.session.count = req.session.count || 0; |
dotjs userscript for visualizing package.json
files (if present) underneath the tree view.
Very useful for navigating Node.JS projects
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
# You need to have bash-completion installed, e.g. `brew install bash-completion`. | |
# And you may need to have git installed this way too, e.g. `brew install git`. | |
# This is needed for bash completion: | |
if [ -f `brew --prefix`/etc/bash_completion ]; then | |
. `brew --prefix`/etc/bash_completion | |
fi | |
# And here's the sexy prompt that shows the Git branch for git repos: | |
export PS1='\n\033[1m\w$(__git_ps1 " (%s)") $\033[0m ' |
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
JSON._dateReviver = function (k,v) { | |
if (v.length !== 24 || typeof v !== 'string') return v | |
try {return new Date(v)} | |
catch(e) {return v} | |
} | |
JSON.parseWithDates = function (obj) { | |
return JSON.parse(obj, JSON._dateReviver); | |
} |
OlderNewer