Skip to content

Instantly share code, notes, and snippets.

@mihs
mihs / gist:5663080
Last active December 17, 2015 19:49
Working around implicit router in express 3.x ( https://github.com/visionmedia/express/issues/1404 ). Do this after you have loaded your middleware and set up your routes.
# router was automatically added, remove it and add it again at the end
for index, middleware of app.stack
if middleware.handle == app.router
routerAt = index
break
if routerAt
app.stack.splice(routerAt, 1)
app.use(app.router)
@mihs
mihs / gmail
Created May 6, 2014 10:20
Run Chromium with a separate profile for Gmail
#!/bin/sh
if [ ! -d $HOME/.config/chromium/gmail ]; then
mkdir -p $HOME/.config/chromium/gmail
fi
chromium-browser --user-data-dir=$HOME/.config/chromium/gmail gmail.com
@mihs
mihs / gist:fbd9fef145e1098e607f
Created December 19, 2014 16:27
convert all views from haml to erb in a rails directory using herbalizer
find -L . -name *.html.haml -exec bash -c 'herbalizer {} | tee `echo {} | sed s/haml$/erb/`' \;