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/bash | |
for branch in $(git branch | sed 's/* //'); do | |
ahead=$(git log --oneline main..$branch | wc -l | tr -d ' '); | |
behind=$(git log --oneline $branch..main | wc -l | tr -d ' '); | |
printf "+%5s, -%5s : %s\n" "$ahead" "$behind" "$branch"; | |
done |
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
<?php | |
function url2png_v6($url, $args) { | |
# Get your apikey from http://url2png.com/plans | |
$URL2PNG_APIKEY = "PXXXX"; | |
$URL2PNG_SECRET = "SXXXX"; | |
# urlencode request target | |
$options['url'] = urlencode($url); |
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
from django import template | |
register = template.Library() | |
@register.filter(name='indent') | |
def indent_string(val, num_spaces=4): | |
return val.replace('\n', '\n' + ' '*num_spaces) |
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
<div ng-repeat="m in milestone_choices" class="row-fluid"> | |
<label><input type="radio" name="meaningless" value="(( $index ))" ng-model="milestone_data.index" /> | |
<span ng-bind="m.title"></span></label> | |
</div> |
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/bash | |
function f1() { | |
echo 'In f1' | |
echo '' | |
echo ${BASH_SOURCE[0]} + ${FUNCNAME[0]} | |
echo ${BASH_SOURCE[1]} + ${FUNCNAME[1]} | |
} | |
echo 'in bash_source_test.sh' |
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/bash | |
# Temporarily save the old values so we can restore them after execution | |
SOURCE_TEMP=$SOURCE | |
DIR_TEMP=$DIR | |
SOURCE="${BASH_SOURCE[0]}" | |
# Go through all symlinks to find the ultimate location of the source file | |
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done | |
# Get an absolute path to the directory that contains this file |
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
*.pyc |
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
# cd into the root code directory | |
cd `git rev-parse --show-cdup`. | |
diffJSFiles=`git diff origin/master HEAD --name-only | grep "\.js$"` | |
echo "Validating Javascript Files with JS Lint:" | |
echo "$diffJSFiles" | |
jsPassed=0 | |
for jsFile in $diffJSFiles; do |
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 | |
# Check if the individual developer has his own hook | |
CMD_NAME=`basename $0` | |
if [ -f $GIT_DIR/hooks/personal/$CMD_NAME ] | |
then | |
# If so, run it. $@ passes all the command line arguments passed to this function | |
# If the personal hook fails, fail this one as well | |
if ! $GIT_DIR/hooks/personal/$CMD_NAME $@ | |
then |
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
# Only counts the file types listed below. Possible improvements would be to add more | |
# or add arguments to handle that. | |
# Only executes in the current directory. Possible improvement - make it an argument | |
find . | egrep '(\.py)|(\.php)|(\.js)|(\.css)' | xargs wc -l |