This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function S4() { | |
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); | |
} | |
function UUID(short) { | |
if (short) { | |
return S4() + S4(); | |
} | |
return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
current_branch=$(git symbolic-ref HEAD | awk -F / '{print $3}') | |
if [ "$current_branch" != "master" ]; then | |
echo "WARNING: You are on branch $current_branch, NOT master." | |
fi | |
echo "Fetching merged branches..." | |
git remote prune origin | |
remote_branches=$(git branch -r --merged | grep -v '/master$' | grep -v "/$current_branch$") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// (c) 2012-2013 Instant Communication Bhd, under terms of ISC License. | |
// | |
// Process index.html to add md5ized path mapping for RequireJS. | |
// | |
// Needs empty CacheBust variable to be defined (see replacement logic), which | |
// afterwards should be used in `require.config({paths: CacheBust});` call. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# (c) 2012 Alexander Solovyov under terms of ISC License | |
# to use, install dependencies: | |
# pip install opster requests | |
import os, sys, json | |
from subprocess import check_output | |
import requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# git-req -- make a pull request | |
# | |
# Assumes branch is pushed to same repo as pull request is made to (origin) | |
# | |
# How to obtain GITREQ_TOKEN: | |
# | |
# curl -u "$USER:$PASSWORD" -d '{"scopes": ["repo"], "note": "git-req"}' https://api.github.com/authorizations | |
# | |
# Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging, timeit | |
class LoggedSetItemMixin(object): | |
def __setitem__(self, index, value): | |
logging.info('Setting %r to %r' % (index, value)) | |
super(LoggedSetItemMixin, self).__setitem__(index,value) | |
class LoggingDict(LoggedSetItemMixin, dict): | |
pass |
NewerOlder