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/sh | |
if [ "$2" == "" ]; then | |
>&2 echo "Usage: $0 backup|restore volume_name" | |
exit 1 | |
fi | |
if [ "$1" == "backup" ]; then | |
docker run -it --rm -v $2:/volume -v `pwd`:/backup alpine tar -cjf /backup/$2.tar.bz2 -C /volume ./ | |
elif [ "$1" == "restore" ]; then |
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] | |
cleanup = "!git branch --merged master | grep -v '\\*\\|master\\|develop\\|deploy\\|release\\|staging\\|sprint' | xargs -n 1 git branch -d" |
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
Current ActiveRecord code: | |
Selector Thread reports shared record exists | |
Thread 1 (0.8ms) BEGIN | |
Thread 1 running before_destroy callback | |
Thread 2 (0.6ms) BEGIN | |
Thread 2 running before_destroy callback | |
Selector Thread reports shared record exists | |
Thread 1 running before_destroy callback | |
Thread 2 running before_destroy callback |
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
require 'rubygems' | |
require 'active_record' | |
ActiveRecord::Base.establish_connection("adapter" => "sqlite3", "database" => ":memory:") | |
class Widget < ActiveRecord::Base | |
connection.create_table table_name do |t| | |
t.string :name | |
t.integer :thing_count | |
end unless table_exists? |
NewerOlder