Based on http://stackoverflow.com/questions/1260748/how-do-i-remove-a-git-submodule/16162000#16162000
git submodule deinit path/to/submodule
git rm path/to/submodule
# spec/support/custom_argument_matchers.rb | |
module CustomArgumentMatchers | |
class HashMatching | |
attr_reader :expected | |
def initialize(expected) | |
@expected = expected | |
end | |
def ==(target) |
function! SubstituteInLine(linenumber, regexp, replacement) | |
let line = getline(a:linenumber) | |
let changed = substitute(line, a:regexp, a:replacement, 'g') | |
call setline(a:linenumber, changed) | |
endfunction | |
" Converts | |
" 'abc' => 1 | |
" to | |
" :abc => 1 |
require 'spec_helper' | |
require 'rake' | |
describe 'foo tasks' do | |
before :all do | |
Rake::Task.clear | |
Rake.application.rake_require 'tasks/foo' | |
Rake::Task.define_task(:environment) | |
end |
Based on http://stackoverflow.com/questions/1260748/how-do-i-remove-a-git-submodule/16162000#16162000
git submodule deinit path/to/submodule
git rm path/to/submodule
defmodule FormEncode do | |
def form_encode(params) when is_map(params) do | |
form_encode([], params) | |
end | |
def form_encode(nesting, value) when is_map(value) do | |
Enum.map_join(value, "&", fn({k, v}) -> | |
n1 = Enum.reverse(Enum.reverse(nesting), [k]) | |
form_encode(n1, v) | |
end) |
#!/bin/bash | |
# A pure-bash (3.x+) function for removing duplicates from PATH | |
# Use: | |
# $ export PATH=`uniq-path-bash3.sh` | |
# Separate on ':' | |
OLD_IFS=$IFS | |
IFS=":" | |
# Collect unique items in NEW_PATH |
# f - everyday find | |
# usage: | |
# f filename_fragment [path] | |
# skips whatever you list in _exclude_matches | |
_exclude_matches=(bundle .git *.pyc) | |
_excludes='' | |
for _match in $_exclude_matches; do | |
_excludes="${_excludes}-name '$_match' -prune -o " | |
done |
#!/usr/bin/env sh | |
# Usage: | |
# $ sh rbenv_local_ruby.sh {VERSION} | |
# If VERSION is missing, builds and installs 'local-ruby' | |
VERSION=${1:-local-ruby}; | |
echo $VERSION | |
./configure --prefix=~/.rbenv/versions/$VERSION | |
make |
# Set up a bash function to cd to a Rails app's current directory and set the prompt | |
rails_app () | |
{ | |
cd "$APP_PATH/current"; | |
export PS1="(\$APP_NAME:\$RAILS_ENV)\w>" | |
} | |
my_rails_app () | |
{ |
#!/bin/bash | |
git checkout master | |
SHA1=`git rev-list HEAD | tail -n $1 | head -n 1` | |
git checkout $SHA1 |