Skip to content

Instantly share code, notes, and snippets.

@ohnoitsyou
ohnoitsyou / workon
Last active April 25, 2017 05:44
Quick script to look for directories under git version control and quickly switch to it
#!/bin/bash
if [ -z "$1" ]
then
echo "Please provide a project name"
fi
if [ "-list" == "$1" ]
then
DEBUG=true

Keybase proof

I hereby claim:

  • I am ohnoitsyou on github.
  • I am ohnoitsyou (https://keybase.io/ohnoitsyou) on keybase.
  • I have a public key whose fingerprint is A523 15D1 92ED AAE7 E15D AA0E 5FC5 6CAD E2E3 1430

To claim this, I am signing this object:

@ohnoitsyou
ohnoitsyou / gist:47a072639b0ef79cfb08
Created April 15, 2015 02:27
alternate to Object.keys (node.js)
var foo = {
'alpha': 'puffin',
'beta': 'beagle',
'charlie': 'cat',
'delta': 'dog'
};
var keys = [],
i = 0;
for (keys[i++] in foo) {}
@ohnoitsyou
ohnoitsyou / gist:8225834
Created January 2, 2014 20:08
bash shell with active git branch
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
}
function proml {
local BLUE="\[\033[0;34m\]"
@ohnoitsyou
ohnoitsyou / express+hbs boilerplate
Last active January 1, 2016 15:19
Expressjs with HBS boilerplate
var express = require('express')
, hbs = require('express-hbs')
, http = require('http')
, app = express()
, server = http.createServer(app)
;
server.listen(3000);
app.engine('hbs', hbs.express3({