Skip to content

Instantly share code, notes, and snippets.

@timrauhut
timrauhut / .gitignore
Created August 7, 2012 08:17 — forked from FND/.gitignore
test case for eager loading of nested associations with DataMapper
Gemfile.lock
@timrauhut
timrauhut / gist:964547
Created May 10, 2011 14:15
Simple nokogiri xsd validator
require 'rubygems'
require 'nokogiri'
def validate(document_path, schema_path)
schema = Nokogiri::XML::Schema(File.read(schema_path))
document = Nokogiri::XML(File.read(document_path))
schema.validate(document)
end
validate('document.xml', 'schema.xsd').each do |error|
puts error.message
@timrauhut
timrauhut / gist:959004
Created May 6, 2011 14:03
Fast remote branch copying
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
git branch --track ${branch##*/} $branch
done
#!/bin/bash
for branch in `git branch -l | grep -v master`; do
git push mirror $branch
done