This template script was retrieved from BigSmoke's Blog on 18 February 2011. It was originally authored by [Wiebe Cazemier](mailto:Wiebe Cazemier ) and he deserves the credit. I am putting it on gist.github.com so I don't lose it, mostly, although I hope someone else is able to find it as useful as I do.
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
# usage: | |
# bundle exec rake locale:file RAILS_ENV=production | |
# if you want to export a different locale (not en.yml), provide locale option, as follows: | |
# bundle exec rake locale:file RAILS_ENV=production locale=ru | |
require 'mongo-i18n' | |
def write_to_database(sc, path, value) | |
key = path.join('.') | |
sc[key] = value.to_json |
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 | |
# This script installs to /usr/local only. To install elsewhere you can just | |
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like. | |
module Tty extend self | |
def blue; bold 34; end | |
def white; bold 39; end | |
def red; underline 31; end | |
def reset; escape 0; end | |
def bold n; escape "1;#{n}" 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
This is meant to supplement the question on StackOverflow, here: | |
http://stackoverflow.com/questions/7137985/git-rebase-i-head7-showing-only-noop-in-editor |
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 | |
# | |
# Author: Ryan Long (ryan@rtlong.com) | |
# | |
# This script requires two arguments, akin to the `mv` command, and it automates the following process: | |
# - mv $1 $2 | |
# - ln -s $2 $1 | |
# | |
# More info is below in the dohelp() function; or call the script with the `--help' option. | |
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 'connection_pool' | |
require 'redis' | |
COUNT=1000 | |
$pool = ConnectionPool.new(size: 5, timeout: 10) { Redis.new } | |
def dont_leak_connection |
NewerOlder