Skip to content

Instantly share code, notes, and snippets.

@dannyroberts
dannyroberts / README.md
Last active February 7, 2020 18:08
requires other stuff to be installed (obviously git)

Install

cd ~
git clone https://gist.github.com/5165174.git bash
ln -s bash/bash_profile .bash_profile
alias branch="git branch | grep '^\*' | sed 's/* //'"
alias push-current='git push origin $(branch)'
@dannyroberts
dannyroberts / update-code.sh
Last active December 12, 2015 09:19
bash function to fetch the latest master on all submodules in parallel, wait until they're all updated, and then delete all pyc files
function delete-pyc() {
find . -name '*.pyc' -delete
}
function pull-latest-master() {
git checkout master; git pull &
git submodule foreach --recursive 'git checkout master; git pull &'
until [ -z "$(ps aux | grep '[g]it pull')" ]; do sleep 1; done
}
function update-code() {
pull-latest-master
/* copied from http://www.netlobo.com/url_query_string_javascript.html */
function get_url_param( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else