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
#!/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 |
#!/bin/bash | |
git checkout master | |
SHA1=`git rev-list HEAD | tail -n $1 | head -n 1` | |
git checkout $SHA1 |
# 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 |
# Copy all modifications to a file from one repo to another | |
for c in `git --git-dir=../path/to/repo/.git log --reverse --pretty=tformat:"%H" -- path/to/file`; do | |
git --git-dir=../path/to/repo/.git format-patch --keep-subject -1 --stdout $c | git am --3way --keep; | |
done |
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
# While modifying Ruby source, it's handy to only run the tests on the file you're modifying. | |
# See: | |
# * doc/contributing.rdoc in Ruby source, | |
# * https://bugs.ruby-lang.org/projects/ruby/wiki/DeveloperHowto | |
# Run core tests: | |
make test | |
# Run all tests: |
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) |