Skip to content

Instantly share code, notes, and snippets.

View mguterl's full-sized avatar

Mike Guterl mguterl

View GitHub Profile
michaelguterl@carini ~/code/tmp/serialized_attributes[master]$ VERSION=3.0.4 ruby test/serialized_attributes_test.rb
Loaded suite test/serialized_attributes_test
Started
.................................E...........E..............................
Finished in 0.197731 seconds.
1) Error:
test_attempts_to_re-encode_data_when_saving(SerializedAttributeWithSerializedDataTestWithActiveSupportJson):
ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished
/Users/michaelguterl/.rvm/gems/ree-1.8.7-2010.02/gems/activerecord-3.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:317:in `retrieve_connection'
require 'uri'
require 'psych'
require 'net/http'
require 'meme' # Install meme_generator
module Campfire
class API
attr_reader :uri, :token, :pass
module Sunspot
class ResqueSessionProxy < Sunspot::SessionProxy::AbstractSessionProxy
attr_reader :original_session
delegate :config, :delete_dirty?, :dirty?,
:new_search, :search,
:new_more_like_this, :more_like_this,
:remove, :remove!,
class Object
def inspect
raise "inspect called, check backtrace for source"
end
end
module Kernel
alias_method :puts_without_check, :puts
def puts(*args)
args.each do |arg|
raise "puts called, check the backtrace for the source" if arg.to_s =~ /Class:/
end
puts_without_check(*args)
end
alias_method :print_without_check, :print
Mailer.should deliver(:job_application).with(@job.id, @user.id)
module Report
class EmployerApplicationReport
attr_accessor :job, :archived
def initialize(options = {})
options ||= {}
options.reverse_merge!(:archived => false)
options.each do |k, v|
#!/bin/bash
git clone https://github.com/nz/sunspot.git
cd sunspot/sunspot
git co geohash_neighbors
bundle
bundle exec spec lib/sunspot/query/geo.rb
# F
{
"2010-11-12": [{
"60-69": "10",
"20-29": "0",
"80-89": "29",
"70-79": "18",
"40-49": "26",
"30-39": "14",
"50-59": "6",
"10-19": "25",
require 'pp'
require 'request_log_analyzer'
file_format = RequestLogAnalyzer::FileFormat.load('rails', :all)
parser = RequestLogAnalyzer::Source::LogParser.new(file_format, :source_files => 'production.log.1')
parser.each_request do |request|
if ['Staff:ResumeSearchLicensesController', 'Staff::JobPostingLicensesController'].include?(request[:controller]) && request[:action] == 'create'
pp request[:params]
end