Skip to content

Instantly share code, notes, and snippets.

View brandon-beacher's full-sized avatar
💭
🦑

Brandon Beacher brandon-beacher

💭
🦑
View GitHub Profile
# populate test database before running tests
Rake::Task["db:test:prepare"].enhance do
Customer.establish_connection "test"
Domain.establish_connection "test"
PopulationHelper.populate
end
:plain
Original ID,Email,Last Name,First Name,Honorific,Gender,Organization,Clergy?,Listed?,Primary Street,Primary City,Primary State,Primary Zip,Primary Phone
#{ FasterCSV.generate do |csv|
@people.each do |p|
csv << [
p["original_id"],
p["email"],
p["last_name"],
p["first_name"],
p["honorific"],
desc 'Print out all defined routes in match order, with names.'
task :routes => :environment do
routes = ActionController::Routing::Routes.routes.collect do |route|
name = ActionController::Routing::Routes.named_routes.routes.index(route).to_s
verb = route.conditions[:method].to_s.upcase
segs = route.segments.inject("") { |str,s| str << s.to_s }
segs.chop! if segs.length > 1
reqs = route.requirements.empty? ? "" : route.requirements.inspect
{:name => name, :verb => verb, :segs => segs, :reqs => reqs}
end
def index
finder = Person.ordered
finder = finder.matches params[:query] if params[:query]
finder = finder.enabled unless params[:disabled]
case params[:format]
when "csv"
@people = finder.find :all
else
@people = finder.paginate :page => params[:page], :per_page => params[:per_page]
#
# deb cdrom:[Ubuntu-Server 6.06 _Dapper Drake_ - Release amd64 (20060531)]/ edgy main restricted
# deb cdrom:[Ubuntu-Server 6.06 _Dapper Drake_ - Release amd64 (20060531)]/ edgy main restricted
deb http://archive.ubuntu.com/ubuntu/ feisty main restricted
deb-src http://archive.ubuntu.com/ubuntu/ feisty main restricted
## Major bug fix updates produced after the final release of the
Get:1 http://security.ubuntu.com feisty-security Release.gpg [189B]
Ign http://archive.ubuntu.com feisty Release.gpg
Get:2 http://archive.ubuntu.com feisty-updates Release.gpg [189B]
Ign http://us.archive.ubuntu.com feisty Release.gpg
Hit http://security.ubuntu.com feisty-security Release
Ign http://archive.ubuntu.com feisty Release
Ign http://us.archive.ubuntu.com feisty Release
Ign http://us.archive.ubuntu.com feisty/universe Packages
Hit http://archive.ubuntu.com feisty-updates Release
Hit http://security.ubuntu.com feisty-security/main Packages
# each
def self.lookup_primary_email(person_id)
emails_for_person = emails[person_id] || {}
emails_for_person.values.flatten.each do |email|
return email if email["primary"] == "1"
end
nil
end
class KookieStore < CGI::Session::CookieStore
private
def read_cookie
# use the real cookie if we can
cookie = super
unless cookie
# didn't find the real cookie, is this a multipart upload?
match_data = /^multipart\/form-data; boundary=(.+)/.match @session.cgi.env_table["CONTENT_TYPE"]
class DigitalFaith::AmazonSimplePayTransactionsController < DigitalFaithController
before_filter :find_instance
def abandon
AmazonSimplePayTransaction.create! attributes
flash[:error] = "Your payment has been canceled"
redirect_to polymorphic_failure_path
end
def prepare
- require "enumerator"
#Images
- if images.empty?
%h4 No images
- else
- images.each_slice(3) do |slice|
.row
- slice.each do |image|
.image
= link_to image_tag(image.public_filename(:web)), management_image_path(@parish, image)