Skip to content

Instantly share code, notes, and snippets.

View aselder's full-sized avatar

Andrew Selder aselder

View GitHub Profile
@aselder
aselder / gist:668475
Created November 8, 2010 23:31
Gemfile
source :rubygems
gem 'mysql'
gem 'rails', '2.3.8'
gem 'test-unit', '1.2.3'
gem 'oauth', "0.4.3"
gem 'haml', '3.0.12'
gem 'uuid', '2.3.1'
gem 'tlsmail', '0.0.1'
gem 'hpricot', '0.8.3'
@aselder
aselder / gist:668480
Created November 8, 2010 23:33
DEBUG_RESOLVER output in Infinite Loop
Last login: Mon Nov 8 14:15:15 on ttys005
-bash: /Users/andrew/Fansnap/fancat/gitsvn/code/devtools/bashrc: No such file or directory
andrew:~$ cd /Volumes/WorkDisk/Fancat/fancat/gitsvn/codeandrew:code[bundler*]$ export DEBUG_RESOLVER=true
andrew:code[bundler*]$ bundle install
1
Fetching source index for http://rubygems.org/
2
3
==== Iterating ====
development:
jmx_port: 9990
log_dir: logs/development
data_dir: data/development
rsync_port: 8993
replicate_as_master: false
replicate_as_slave: false
search_master_hostname: not_used_in_dev_or_test
search_master_port: not_used_in_dev_or_test
hostname: localhost
ruby-1.9.2-p136 :001 > require 'spec/rails'
=> []
ruby-1.9.2-p136 :002 > Spec::Example::ExampleGroupHierarchy.new(::Spec::Rails::Example::ControllerExampleGroup)
1: Spec::Rails::Example::ControllerExampleGroup
2: Spec::Rails::Example::ControllerExampleGroup
3: Spec::Rails::Example::ControllerExampleGroup
1: Spec::Rails::Example::FunctionalExampleGroup
2: Spec::Rails::Example::FunctionalExampleGroup
3: Spec::Rails::Example::FunctionalExampleGroup
1: ActionController::TestCase
@aselder
aselder / gist:944943
Created April 27, 2011 19:03
Patch for param parsing to check for encoded latin-1 URL parameters
#
# Source: https://rails.lighthouseapp.com/projects/8994/tickets/2188-i18n-fails-with-multibyte-strings-in-ruby-19-similar-to-2038
# (fix_params.rb)
module ActionController
class Request
private
def check_string_encoding(str)
str.valid_encoding? ? str : str.force_encoding("iso-8859-1").encode("utf-8")
@aselder
aselder / gist:1163027
Created August 22, 2011 17:51
Internal Ruby Error when running SimpleCov
/Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/ebay-1.1/lib/eBayMappingRegistry.rb:31220: [BUG] bug
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
-- control frame ----------
c:0034 p:66249 s:0116 b:0116 l:000115 d:000115 CLASS /Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/ebay-1.1/lib/eBayMappingRegistry.rb:31220
c:0033 p:0039 s:0114 b:0114 l:000113 d:000113 TOP /Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/ebay-1.1/lib/eBayMappingRegistry.rb:4
c:0032 p:---- s:0112 b:0112 l:000111 d:000111 FINISH
c:0031 p:---- s:0110 b:0110 l:000109 d:000109 CFUNC :require
c:0030 p:0055 s:0106 b:0106 l:000105 d:000105 METHOD /Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:184
c:0029 p:0027 s:0100 b:0100 l:000099 d:000099 TOP /Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/ebay-1.1/lib/eBayDriver.rb:2
@aselder
aselder / gist:1168728
Created August 24, 2011 18:08
Coverage blowup on EBay gem
/Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/ebay-1.1/lib/eBayMappingRegistry.rb:31220: [BUG] bug
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0]
-- control frame ----------
c:0033 p:66249 s:0108 b:0108 l:000107 d:000107 CLASS /Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/ebay-1.1/lib/eBayMappingRegistry.rb:31220
c:0032 p:0039 s:0106 b:0106 l:000105 d:000105 TOP /Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/ebay-1.1/lib/eBayMappingRegistry.rb:4
c:0031 p:---- s:0104 b:0104 l:000103 d:000103 FINISH
c:0030 p:---- s:0102 b:0102 l:000101 d:000101 CFUNC :require
c:0029 p:0027 s:0098 b:0098 l:000097 d:000097 TOP /Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/ebay-1.1/lib/eBayDriver.rb:2
c:0028 p:---- s:0096 b:0096 l:000095 d:000095 FINISH
@aselder
aselder / gist:1331173
Created November 1, 2011 16:57
Compilation error under 1.3.5
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/andrew/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
extconf.rb:7: Use RbConfig instead of obsolete and deprecated Config.
Touching aclocal.m4 in libmemcached.
touch -r libmemcached-0.32/m4/visibility.m4 libmemcached-0.32/configure.ac libmemcached-0.32/m4/pandora_have_sasl.m4 libmemcached-0.32/m4/aclocal.m4
Configuring libmemcached.
env CFLAGS='-fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -pipe -pipe' LDFLAGS='-fPIC -L. -L/usr/local/lib -L. -L/usr/local/lib -L/Users/andrew/.rvm/rubies/ruby-1.9.3-p0/lib' ./configure --prefix=/Users/andrew/.rvm/gems/ruby-1.9.3-p0/gems/memcached-1.3.5/ext --without-memcached --disable-shared --disable-utils --disable-dependency-tracking CC="clang" 2>&1
checking build system type... i386-apple-darwin11.2.0
@aselder
aselder / gist:1354253
Created November 10, 2011 06:20
Mangled Nokogiri Doc
#<Nokogiri::HTML::Document:0x..fdbc0ebe8 name="document" children=[#<Nokogiri::XML::DTD:0x..fdbc0e526 name="HTML">,
#<Nokogiri::XML::Comment:0x..fdbc0e4fe "\nbody { font-family: arial, helvetica, sans-serif; font-size: 12px; font-weight:
normal; color: black; background: white;}\nth,td { font-size: 10px;}\nh1 { font-size: x-large; margin-bottom: 0.5em;}\nh2
{ font-family: helvetica, arial; font-size: x-large; font-weight: bold; font-style: italic; color: #6020a0; margin-top:
0em; margin-bottom: 0em;}\nh3 { font-family: helvetica, arial; font-size: 16px; font-weight: bold; color: #b00040;
background: #e8e8d0; margin-top: 0em; margin-bottom: 0em;}\nli { margin-top: 0.25em; margin-right: 2em;}\n.hr
{margin-top: 0.25em; border-color: black; border-bottom-style: solid;}\n.titre\t{background: #20D0D0;color: #000000;
font-weight: bold; text-align: center;}\n.total\t{background: #20D0D0;color: #ffff80;}\n.frontend\t{background: #e8e8d0;}
\n.socket\t{background: #d0d0d0;}\n.backend\t{background: #e8e8d0;}\n.act
@aselder
aselder / gist:1354268
Created November 10, 2011 06:32
Correct Document
#<Nokogiri::HTML::Document:0x3fefde0fafec name="document" children=[#<Nokogiri::XML::DTD:0x3fefde0fac7c name="HTML">,
#<Nokogiri::XML::Element:0x3fefde0fa4fc name="html" children=[#<Nokogiri::XML::Element:0x3fefde0fa2f4 name="head"
children=[#<Nokogiri::XML::Element:0x3fefde0fa0ec name="title" children=[#<Nokogiri::XML::Text:0x3fefde0f9ee4
"Statistics Report for HAProxy">]>, #<Nokogiri::XML::Element:0x3fefde0f9c64 name="meta"
attributes=[#<Nokogiri::XML::Attr:0x3fefde0f9c00 name="http-equiv" value="content-type">,
#<Nokogiri::XML::Attr:0x3fefde0efde0 name="content" value="text/html; charset=iso-8859-1">]>,
#<Nokogiri::XML::Element:0x3fefde0ef5e8 name="style" attributes=[#<Nokogiri::XML::Attr:0x3fefde0ef584 name="type"
value="text/css">] children=[#<Nokogiri::XML::CDATA:0x3fefde0eb010 "<!--\nbody { font-family: arial, helvetica,
sans-serif; font-size: 12px; font-weight: normal; color: black; background: white;}\nth,td { font-size: 10px;}\nh1 {
font-size: x-large; margin-bottom: 0.5em;}\nh2 { font-family: helve