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
git log --name-status | gawk '/Richard Howard/{c = 1} /^commit/{c = 0} /^M |^A /{ if (c == 1) print $2 }' | grep '.js$\|.html$' | uniq | while read F; do if [ -f "$F" ]; then jshint "$F" --config=~/.jshintrc; fi; done |
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 | |
# Examine a pull request! | |
# Usage: $0 <github username> <branch name> OR $0 <pull request #> | |
# TODO: move to env? | |
MY_GH_USER=rhowardiv | |
MY_GH_PASS=XXXXXXXX | |
GH_REPO=AYI |
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 | |
# A wrapper for ack to provide context for results; i.e. name of surrounding function or class | |
# context regex: match lines that qualify as "context" | |
# this could certainly be improved but it's okay for now | |
CONT='\<function\>.*(\|\<class\s\+[a-zA-Z_]\+' | |
proceed() { | |
while read LINE; do |
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 | |
# Just a wrapper around lsyncd | |
# Keep two places in sync | |
HERE=/home/rhoward/ayi/ | |
THERE=rhoward-dev.ayisnap.com:/var/www/html/areyouinterested.com | |
# Check that no previously running syncs are still running; | |
# this causes boffo logging | |
CURRENT_SYNC=$(ps aux | grep "rsync.\+$HERE" | grep -v '0 grep') |
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
function contentWithTwitterURLShortening(c) { | |
// t.co URLs are currently max 20 chars, but since that is subject to | |
// expansion we're leaving some elbow room and assuming 25 | |
return c.replace(/http(s?):\/\/[-\w]+(\.\w[-\w]*)+(:\d+)?(\/[^.!,?;"'<>()\[\]{}\s\x7F-\xFF]*(?:[.!,?]+[^.!,?;"'<>()\[\]{}\s\x7F-\xFF]+)*)?/g, "http$1://t.co/xxxxxxxxxxxxx"); | |
} |
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
/* | |
* Character Count Plugin - jQuery plugin | |
* Dynamic character count for text areas and input fields | |
* written by Alen Grakalic | |
* http://cssglobe.com/post/7161/jquery-plugin-simplest-twitterlike-dynamic-character-count-for-textareas | |
* and Richard Howard, Roubini Global Economics | |
* http://www.roubini.com | |
* | |
* Copyright (c) 2009 Alen Grakalic (http://cssglobe.com) | |
* Dual licensed under the MIT (MIT-LICENSE.txt) |
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
# First look what happens with a simple but naive approach. | |
# I'll try recreating the branch in-place and merging in changes from the old version. | |
# Should be easy, right? svn never forgets, right? ... | |
cd ~/mybranch | |
SVH=/repo/root | |
# (for this approach we need the rev #'s for the start and end of the branch) | |
START_REV=$(svn log --stop-on-copy | grep '^r[0-9]' | tail -n 1 | sed s/^r// | awk '{print $1}') | |
END_REV=$(svn log --stop-on-copy | grep '^r[0-9]' | head -n+1 | sed s/^r// | awk '{print $1}') |
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 | |
F=$1 | |
shift | |
echo $@ | xargs -n1 -P4 ptail $F |
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 | |
sed 's/^[ ]\+//' | sed 's/[ ]\+$//' | xargs -d'\n' $@ |