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
SELECT table_schema "DB", sum( data_length + index_length ) / 1024 / 1024 / 1024 "Size (GB)" FROM information_schema.TABLES GROUP BY table_schema |
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
# IRBRC file by Iain Hecker, http://iain.nl | |
# put all this in your ~/.irbrc | |
require 'rubygems' | |
require 'yaml' | |
alias q exit | |
class Object | |
def local_methods | |
(methods - Object.instance_methods).sort |
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
module Autotest::GnomeNotify | |
# Time notification will be displayed before disappearing automatically | |
EXPIRATION_IN_SECONDS = 3 | |
ERROR_STOCK_ICON = "gtk-cancel" | |
WARNING_STOCK_ICON = "gtk-dialog-warning" | |
SUCCESS_STOCK_ICON = "gtk-ok" | |
# Convenience method to send an error notification message | |
# | |
# [stock_icon] Stock icon name of icon to display |
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 'factory_girl' | |
require 'faker' | |
Dir.glob(File.join(File.dirname(__FILE__), '../../spec/factories/*.rb')).each {|f| require f } |
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
# Install vim with ruby support | |
sudo aptitude install vim-gnome | |
# Install things to compile | |
sudo aptitude install bison build-essential zlib1g-dev libssl-dev libreadline5-dev libxml2-dev | |
# Database stuff | |
sudo aptitude install sqlite3 libsqlite3-dev | |
sudo aptitude install mysql-server mysql-client libmysqlclient-dev |
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
rvm_gemset_create_on_use_flag=1 | |
rvm gemset use project_name |
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 | |
MYSQL="mysql -h HOST -u USERNAME -pPASSWORD -D DB_NAME" | |
$MYSQL -BNe "show tables" | awk '{print "set foreign_key_checks=0; drop table `" $1 "`;"}' | $MYSQL | |
unset MYSQL |
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
# Deflate for clients that support it. | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/css | |
AddOutputFilterByType DEFLATE application/xml | |
AddOutputFilterByType DEFLATE application/xhtml+xml | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/x-javascript |
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
Given /^I will confirm on next step$/ do | |
begin | |
evaluate_script("window.alert = function(msg) { return true; }") | |
evaluate_script("window.confirm = function(msg) { return true; }") | |
rescue Capybara::NotSupportedByDriverError | |
end | |
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
# include at least one source and the rails gem | |
source :gemcutter | |
gem 'rails', '~> 2.3.5', :require => nil | |
gem 'sqlite3-ruby', :require => 'sqlite3' | |
# Devise 1.0.2 is not a valid gem plugin for Rails, so use git until 1.0.3 | |
# gem 'devise', :git => 'git://github.com/plataformatec/devise.git', :ref => 'v1.0' | |
group :development do | |
# bundler requires these gems in development |