Skip to content

Instantly share code, notes, and snippets.

@branneman
branneman / better-nodejs-require-paths.md
Last active April 25, 2024 13:21
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

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

@gregorynicholas
gregorynicholas / .inputrc
Last active April 19, 2024 04:10
OSX .inputrc to make terminal way better. and by better i mean i'm naked
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": history-search-backward
"\e[6~": history-search-forward
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
@evocateur
evocateur / fixconsolas
Created March 15, 2009 00:15
Fix Consolas's line-height on OS X
#!/bin/bash
#
# Requires ftxdumperfuser from http://developer.apple.com/textfonts/download/
#
# Usage: fixconsolas [files ...]
# When called with no arguments, it attempts to operate on every TrueType
# file in the current directory.
#
# References:
# http://bandes-storch.net/blog/2008/12/21/consolas-controlled/#comment-2042