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
# Switch back to system just to make sure | |
rvm use system | |
# Print a list of all gems installed on the system | |
gem list | awk '{print $1}' > gems.txt | |
# Switch to the new version of ruby | |
rvm use ree | |
# Install each gem from the list, skipping documentation |
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
def self.up | |
if connection.tables.include?('posts') | |
drop_table :posts | |
end | |
end |
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! s:ToggleDoEndOrBrackets() | |
let char = getline('.')[col('.')-1] | |
if char =~ '[{}]' | |
if char=='}' | |
norm % | |
endif | |
norm h | |
" Bracket touching previous word | |
if getline('.')[col('.')-1] =~ '[^ ;]' | |
exe "norm! a " |
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
#compdef hitch | |
__hitch_authors() { | |
local expl | |
local -a _authors | |
if [ -f $HOME/.hitch_pairs ]; then | |
_authors=(${${(f)"$(cat $HOME/.hitch_pairs | awk '/:/ { print }')"}/:[ $'\t']##/:}) | |
fi | |
_describe -t hitch-authors 'hitch authors' _authors "$@" | |
} |
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 ruby | |
# Adapted from https://gist.github.com/946311 | |
# | |
# To use, put something like the following in your .bashrc.local: | |
# | |
# alias harvest='rvm use 1.9.2@harvester;harvester;cd ..;cd -' | |
author = `git config --global user.name`.chomp |
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
[alias] | |
add-untracked = !"git status --porcelain | awk '/\\?\\?/{ print $2 }' | xargs git add" |
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 | |
USAGE="Usage: $0 [ip_address | reset]" | |
if [ "$#" == "0" ]; then | |
echo "$USAGE" | |
exit 1 | |
fi |
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 bash | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "ERROR: You have a dirty working copy. This command would remove any files not already checked in" | |
exit 1 | |
fi | |
log() { | |
if [ -z "$quiet" ]; then | |
echo |
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
(use 'clojure.test) | |
(deftest tracing-paths | |
(testing "trace-paths" | |
(is (= (trace-paths {:a nil} :a) | |
[[:a]])) | |
(is (= (trace-paths {:a #{:b} | |
:b nil} :a) |
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
{ | |
"*" : { | |
"start" : "lein repl", | |
}, | |
"src/*.clj": { | |
"command": "namespace", | |
"alternate": "test/{}_test.clj", | |
"template": "(ns {dot|hyphenate})\n\n" | |
}, | |
"test/*_test.clj": { |
OlderNewer