Skip to content

Instantly share code, notes, and snippets.

View mauricesvay's full-sized avatar
💭
🍗

Maurice Svay mauricesvay

💭
🍗
View GitHub Profile
@mauricesvay
mauricesvay / prettyprint.js
Created September 10, 2012 16:26 — forked from knowtheory/prettyprint.js
A pretty printer for Javascript objects that looks like Ruby's pp formatter. In use on Rhino, untested elsewhere.
function pp(object, depth, embedded) {
typeof(depth) == "number" || (depth = 0)
typeof(embedded) == "boolean" || (embedded = false)
var newline = false
var spacer = function(depth) { var spaces = ""; for (var i=0;i<depth;i++) { spaces += " "}; return spaces }
var pretty = ""
if ( typeof(object) == "undefined" ) { pretty += "undefined" }
else if ( typeof(object) == "boolean" ||
typeof(object) == "number" ) { pretty += object.toString() }
else if ( typeof(object) == "string" ) { pretty += "\"" + object + "\"" }
#!/bin/bash
# update hooks; note that this hook will still execute its current version and not
# the updated one
#git pull --rebase &>/dev/null
branch_name=$( git rev-parse --abbrev-ref HEAD )
is_special_branch=$( echo "${branch_name}" | grep -i "^\(hotfix\|develop\|master\|HEAD\)" )
if [ ! "${is_special_branch}" ]