View postgresql.conf
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
fsync = off | |
synchronous_commit = off | |
full_page_writes = off |
View import-sepa-mandates-to-ca.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
#encoding: utf-8 | |
# This HACK imports SEPA Mandates from a CSV file to | |
# Crédit Agricole SEPA System via their HTML API. :) | |
# | |
# Good luck with this! | |
# | |
require 'mechanize' | |
require 'virtus' |
View this-week-in-rails-sample
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
--- | |
layout: post | |
title: "This week in Rails: 4.2.0 Final, autoload explained, deep_munge and more!" | |
categories: news | |
author: chancancode | |
published: true | |
date: 2015-01-09 14:04:54 -0800 | |
--- | |
Welcome to _This week in Rails_, your weekly inside scoop of interesting commits, pull requests and more from [Rails](https://github.com/rails/rails). |
View dependencies.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
#!/usr/bin/env ruby | |
# | |
# Generate a graph of dependencies for your stylesheets. | |
# | |
# Requires graphviz | |
# | |
# Run `ruby dependencies.rb | fdp -Tpng > out.png; open out.png` | |
PATH = "app/assets/stylesheets/" |
View chpwd_update_git_vars.sh
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
update_current_git_vars |
View basecamp-time-report-prettyprint.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
#!/usr/bin/env ruby | |
require 'csv' | |
require 'date' | |
CSV::Reader.parse(File.open(ARGV[0])) do |row| | |
date = row[0].match(/^\d{4}-\d{2}-\d{2}/) ? Date.strptime(row[0], "%Y-%m-%d") : row[0] | |
hours = row[2] | |
memo = "#{row[3]} #{row[4]}" | |
puts "#{date} | #{hours} | #{memo}" | |
end |
View migrate_rubygems_to_ruby_enterprise_edition.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
#!/usr/bin/ruby | |
# Migrate rubygems to Ruby Enterprise Edition (REE) | |
# Make REE install the gems used by your default ruby environment. | |
REE_PATH = ENV['REE_PATH'] || Dir.glob('/opt/ruby-enterprise-*').last | |
unless REE_PATH | |
puts "Can't find path to ruby enterprise edition. Please use the following command:" | |
puts "REE_PATH=/path/to/ruby-enterprise ruby migrate-rubygems-to-ree" |
View runner.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
#!/usr/bin/env ruby | |
# script/runner for rails 3.0 | |
APP_PATH = File.expand_path('../../config/environment', __FILE__) | |
require 'rubygems' | |
require 'rails/commands/runner' |
View rspec-set.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
require 'rspec' | |
def set(attribute, &block) | |
before(:all) do | |
instance_variable_set("@#{attribute}", yield) | |
end | |
let(attribute) { instance_variable_get("@#{attribute}") } | |
end |
View rspec-set.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
# Set @@variable_name in a before(:all) block and give access to it | |
# via let(:variable_name) | |
# | |
# Example: | |
# describe Transaction do | |
# set(:transaction) { Factory(:transaction) } | |
# | |
# it "should be in progress" do | |
# transaction.state.should == 'in_progress' | |
# end |
OlderNewer