Skip to content

Instantly share code, notes, and snippets.

View sergiolepore's full-sized avatar
🎮
Game & Narrative Design

Sergio Lepore sergiolepore

🎮
Game & Narrative Design
View GitHub Profile
@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

@danro
danro / starter.sh
Created September 12, 2013 07:00
nodejs forever crontab reboot script
#!/bin/sh
if [ $(ps aux | grep $USER | grep node | grep -v grep | wc -l | tr -s "\n") -eq 0 ]
then
export PATH=/usr/local/bin:$PATH
export NODE_ENV=production
cd /path/to/app && forever --spinSleepTime 10000 start server.js >> forever.log 2>&1
fi
@olistik
olistik / gist:3894072
Created October 15, 2012 18:09
Ubuntu 12.04 Terminator config: solarized theme + iTerm2-like key bindings
# place this file in ~/.config/terminator/config
[global_config]
title_transmit_bg_color = "#d30102"
focus = system
[keybindings]
reset_clear = <Ctrl>R
new_tab = <Ctrl>T
split_horiz = <Ctrl><Shift>E
split_vert = <Ctrl>E
close_term = <Ctrl><Shift>W
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@navinpai
navinpai / README
Created June 9, 2012 19:18
Simple CSS Blinking Cursor
Simple blinking cursor... code from http://xip.io/ ... Ofcourse I don't own the code! Just keeping it here as a reference of the CSS3 code used.
@mattmcmanus
mattmcmanus / css3.styl
Created March 31, 2011 01:40
A collection of mixins for Stylus to make using css3 a breeze
// MIXINS
vendor(prop, args)
-webkit-{prop} args
-moz-{prop} args
-o-{prop} args
{prop} args
animation()
vendor('animation', arguments)