Skip to content

Instantly share code, notes, and snippets.

Aron Jones defrex

Block or report user

Report or block defrex

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
branneman /
Last active Oct 17, 2019
Better local require() paths for Node.js

Better local require() paths for Node.js


When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

tekacs / show
Created Apr 20, 2011
This does something essentially equivalent to if you have a publicly facing server...
View show
# Usage: show <local-port> <subdomain>
function show() {
ssh -tR 1080:$1 vps "sudo ssh -Nl \$USER -L $REMOTE:80: localhost"
You can’t perform that action at this time.