Skip to content

Instantly share code, notes, and snippets.

@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
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

@hanachin
hanachin / swank-coffee.el
Created December 6, 2011 20:21
eval region, coffee-script
;;; swank-coffee.el hanachin_
;;;
;;; Copyright (c) 2010 Ivan Shvedunov. All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; * Redistributions of source code must retain the above copyright
;;; notice, this list of conditions and the following disclaimer.
@takumikinjo
takumikinjo / .gitignore
Created August 5, 2010 13:56
HTML5 Presentation export for Org-mode
README.html
@danlei
danlei / .Xresources
Created July 24, 2010 23:23
.Xresources
!!!!
!!!! .Xresources
!!!!
!!!! Time-stamp: <2010-07-25 01:22:58 danlei>
!!!!
!! xterm
XTerm*font:9x15
XTerm*background:black
XTerm*foreground:gray
@danlei
danlei / ConstituentParser.hs
Created July 2, 2010 15:46
ConstituentParser
module ConstituentParser
where
import Text.ParserCombinators.Parsec
import Control.Monad
import Control.Applicative ((<$>))
symbol = oneOf "!#$%&|*+-/:<=>?@^_~"
@danlei
danlei / cl-init.lisp
Last active September 4, 2015 23:34
cl-init.lisp
;;;;; -*- common-lisp -*-
;;;;;
;;;;; cl-init.lisp
;;;;;
;;;;; CL initialization file. Works for CCL, Allegro, CLISP, and
;;;;; probably SBCL.
;;;;;
;;;;; Time-stamp: <2013-01-27 01:35:53 dhl>
;;;;;
@danlei
danlei / loona.hs
Created March 18, 2010 21:21
loona.hs
----
---- loona.hs
----
---- Time-stamp: <2010-03-08 03:47:53 danlei>
----
module Loona
where
import Text.ParserCombinators.Parsec