dotjs userscript for visualizing package.json files (if present) underneath the tree view.
Very useful for navigating Node.JS projects
| #!/usr/bin/env bash | |
| curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz | |
| mkdir vim && tar xzvf vim.tar.gz -C vim | |
| export PATH=$PATH:/app/vim/bin |
| window.HAL = {} | |
| class HAL.Model extends Backbone.Model | |
| constructor: (attrs) -> | |
| super @parse(_.clone attrs) | |
| parse: (attrs = {}) -> | |
| @links = attrs._links || {} | |
| delete attrs._links | |
| @embedded = attrs._embedded || {} |
| # url.coffee | |
| # by Aseem Kishore ( https://github.com/aseemk ), under MIT license | |
| # | |
| # A simplified wrapper around the native 'url' module that returns "live" | |
| # objects: updates to properties are reflected in related properties. E.g. | |
| # updates to the `port` property will be reflected on the `host` property. | |
| # | |
| # The public API and behavior are pretty close to the native 'url' module's: | |
| # http://nodejs.org/docs/latest/api/url.html Currently lacking / known issues: | |
| # |
| 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); | |
| } |
| # 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 ' |
dotjs userscript for visualizing package.json files (if present) underneath the tree view.
Very useful for navigating Node.JS projects
| 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; |
| { | |
| "adjacencies": { | |
| "node/1": { | |
| "node/2": "rel/1", | |
| "node/3": "rel/2" | |
| }, | |
| "node/2": { | |
| "node/4": "rel/3" | |
| }, | |
| "node/3": { |
Published as a proper npm module!
| // 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>: |