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 | |
# 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
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 | |
# Get a random PR checker | |
# Loops through everyone before showing the same name twice | |
ME=rhoward | |
# Takes optional argument for commit group if you want not from "ALL" | |
COMMIT_GROUP="ALL" | |
if [ $# -gt 0 ]; then | |
COMMIT_GROUP="$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
<?php | |
class Dumb { | |
protected $prop; | |
function __get($p) { | |
if ($p === 'prop') { | |
$this->prop = new Dumber($this); | |
return $this->prop; | |
} | |
} | |
} |
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 diff HEAD^ | |
diff --git a/vimrc b/vimrc | |
index cada33f..18f0b56 100644 | |
--- a/vimrc | |
+++ b/vimrc | |
@@ -275,15 +275,15 @@ endfunction | |
" Find all files in all non-dot directories starting in the working directory. | |
" Fuzzy select one of those. Open the selected file with :e. | |
-nnoremap <leader>f :call SelectaCommand("find * -type f \| lsort", "", ":e")<cr> |
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 | |
LOG=/tmp/sync.log | |
SELF=$(basename "$0") | |
usage() { | |
echo | |
echo "Usage: $SELF LOCALDIR REMOTEDIR" | |
echo "Syncs files in LOCALDIR to REMOTEDIR" | |
echo "Daemonize this yourself with & or nohup" |
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
#!/usr/bin/env python | |
""" | |
Count lines in python functions | |
""" | |
import re | |
def funcs_lengths(lines): | |
""" | |
Loop through lines and yield (function name, line length) |
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 | |
set -e | |
if [[ -z "$DD_APP_KEY" ]]; then | |
echo "I expect the Datadog app key in DD_APP_KEY" | |
exit | |
fi | |
if [[ -z "$DD_API_KEY" ]]; then | |
echo "I expect the Datadog API key in DD_API_KEY" | |
exit |
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 | |
usage() { | |
echo "Interactively show slides from a file" | |
echo | |
echo "Usage:" | |
echo "$0 FILE LINES" | |
echo | |
echo "FILE is the file containing the slides." | |
echo "In the file, each slide is indicated with a simple 'slide' by itself" |