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 | |
require "rubygems" | |
require "sinatra" | |
require "hpricot" | |
require "open-uri" | |
class XKCD | |
attr_accessor :all | |
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 | |
FROM=$1 | |
TO=$2 | |
echo "Spliting '$TO' from '$FROM'" | |
git clone --no-hardlinks $FROM $TO | |
cd $TO | |
git filter-branch --prune-empty --subdirectory-filter $TO HEAD -- --all | |
git reset --hard | |
git gc --aggressive | |
git prune |
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/ruby | |
# cpioxz.rb | |
# Jonathan D. Stott <[email protected]> | |
if ARGV.empty? | |
warn "Usage: #{$0} directory [directories+]" | |
exit 1 | |
end | |
ARGV.each do |dir| |
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/ruby | |
# rewrite_history.rb | |
# Jonathan D. Stott <[email protected]> | |
require 'fileutils' | |
adapters = %w{ | |
mysql_adapter.rb | |
postgres_adapter.rb | |
sqlite3_adapter.rb | |
oracle_adapter.rb |
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 -e | |
repo_combine () { | |
ADAPTER=$1 | |
if [ ! -d dm-more ]; then | |
echo "Cloning solnic's adapter" | |
git clone git://github.com/solnic/dm-more.git | |
cd dm-more | |
git fetch |
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/ruby | |
# Jonathan D. Stott <[email protected]> | |
require 'fileutils' | |
require 'octopi' | |
include Octopi | |
def sh(command) | |
system command || abort(command) | |
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
#!/usr/bin/ruby | |
# Copyright (c) 2010 Jonathan Stott, unless otherwise noted | |
# | |
# Permission is hereby granted, free of charge, to any person ob- | |
# taining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without restric- | |
# tion, including without limitation the rights to use, copy, modi- | |
# fy, merge, publish, distribute, sublicense, and/or sell copies of | |
# the Software, and to permit persons to whom the Software is fur- | |
# nished to do so, subject to the following conditions: |
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
# Sample configuration file for Unicorn (not Rack) | |
worker_processes 1 | |
# listen on the sinatra port | |
listen 4567 | |
# feel free to point this anywhere accessible on the filesystem | |
pid "#{ENV['XDG_CACHE_HOME']}/unicorn.pid" | |
stdout_path "#{ENV['XDG_CACHE_HOME']}/unicorn.log" |
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/ruby | |
# Copyright (c) 2010,2011 Jonathan Stott | |
# | |
# Permission is hereby granted, free of charge, to any person ob- | |
# taining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without restric- | |
# tion, including without limitation the rights to use, copy, modi- | |
# fy, merge, publish, distribute, sublicense, and/or sell copies of | |
# the Software, and to permit persons to whom the Software is fur- | |
# nished to do so, subject to the following conditions: |
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
# Copyright (c) 2010,2011 Jonathan Stott | |
# | |
# Permission is hereby granted, free of charge, to any person ob- | |
# taining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without restric- | |
# tion, including without limitation the rights to use, copy, modi- | |
# fy, merge, publish, distribute, sublicense, and/or sell copies of | |
# the Software, and to permit persons to whom the Software is fur- | |
# nished to do so, subject to the following conditions: | |
# |
OlderNewer