# Custom Personalised bash prompt #
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
This file contains 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/bash | |
rm -rf node_modules && rm -rf bower_components | |
npm cache clean | |
npm install . | |
bower install |
This file contains 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
// This hidden gem was found at http://stackoverflow.com/questions/9865804/proper-way-to-sort-a-backbone-js-collection-on-the-fly (buried in the answers) | |
// Following example above do in the view: | |
// Assign new comparator | |
this.collection.comparator = function( model ) { | |
return model.get( 'lastname' ); | |
} | |
// Resort collection | |
this.collection.sort(); |
This file contains 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!bash | |
HOST="http://127.0.0.1:5984" | |
curl -X PUT $HOST/registry | |
curl -X PUT $HOST/_config/admins/$1 -d '"$2"' | |
npm start --npm-registry-couchapp:couch=http://$1:$2@localhost:5984/registry |
No fuss, no Muss.
Everytime I set up a new ubuntu 14.04 server and I want nodejs globally installed I have to go hunting.
So this just fixes everything.
# hope you ran with sudo
sudo apt-get update
This file contains 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
########## Web Application Development for BASH made easy | |
# This shell script contains a collection of excellent scripts I've found over the years that enhance development. | |
# It is organized much like a traditional etc/*conf file, and I hope others find it useful. | |
# | |
# YOU MUST HAVE X-CODE installed | |
# | |
# Features include: | |
# - Homebrew | |
# - Sexy git bash status prompt | |
# - NodeJS Version Manager (nvm) |
This file contains 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
# Created by .ignore support plugin (hsz.mobi) | |
### Linux template | |
*~ | |
# KDE directory preferences | |
.directory | |
# Linux trash folder which might appear on any partition or disk | |
.Trash-* | |
### JetBrains template |
This file contains 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
/** | |
* Check to see if an object is within radius of another. | |
* @param x1 object1 | |
* @param y1 object1 | |
* @param x2 object2 | |
* @param y2 object2 | |
* @param radius Size of the radius, which is usually | |
* @return returns true if object2 is within radius of object 1 | |
* @example if (InRadius(player.x,player.y,enemy.x,enemy.y,100)) trace ("enemy within a 100 pixel radius of player"); | |
*/ |
This file contains 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
/** | |
* Searches the map for tiles then adds them to the stage | |
* @param map | |
* @param l | |
* @return | |
*/ | |
private static function scanMapByTileOnLayer(map:Map,l:DataTileLayer):Array | |
{ | |
var newTiles:Array = new Array(); | |
var tileIndex:int = 0; |
OlderNewer