Skip to content

Instantly share code, notes, and snippets.

View terrbear's full-sized avatar

terry heath terrbear

View GitHub Profile
module TweetsHelper
def filter_body(body)
newbody = body.clone
newbody = newbody.gsub(Twitter::NAME_REGEX) do |match|
"#{$1}\"#{match[/@\w+/].strip}\":http://www.twitter.com/#{match[/\w+/].strip}"
end
newbody = newbody.gsub(Hashtag::REGEX) do |match|
$0 #spits out "script/server"
#"\"#{$1}\":http://www.hashtags.org/tag/#{match[/\w+/].strip}"
end
existing_invitee_user_ids = []
user_ids[:user_id].each_pair{|key, value|
if value.to_i == 1
existing_invitee_user_ids << key.to_i
end
end
existing_invitee_user_ids.compact!
existing_invitee_user_ids.uniq!
existing_invitee_user_ids
Loading development environment (Rails 2.0.2)
connecting to beanstalk at localhost:11300
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- fiveruns_dash_rails (MissingSourceFile)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /home/theath/.gem/ruby/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
from /home/theath/.gem/ruby/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
from /home/theath/.gem/ruby/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
from /var/www/lockedenvelope/releases/20090411142645/config/environment.rb:73
from /usr/lib/ruby/1.8/irb/init.rb:252:in `require'
from /usr/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
=> {"Resumes"=>{"yahoo:start"=>"1", "Resume"=>[{"CandidateResumeID"=>"62424664", "City"=>"Burlington", "WorkAuthCountry"=>"USA", "CandidateID"=>"33399683", "Experience"=>"1-2", "Country"=>"USA", "id"=>"MzMzOTk2ODM7NjI0MjQ2NjQ7MTI0MTc2MzYwMTsxO0p0bFFSc2d6X0owWGFMT19kNndrQkEtLQ--", "FirstName"=>"Ali", "LastName"=>"Shah", "Degree"=>"BS", "xml:lang"=>"en-US", "State"=>"MA", "Title"=>"Software Engineer", "Language"=>"us", "yahoo:uri"=>"http://hj.yahooapis.com/v1/Resume/MzMzOTk2ODM7NjI0MjQ2NjQ7MTI0MTc2MzYwMTsxO0p0bFFSc2d6X0owWGFMT19kNndrQkEtLQ--", "HireType"=>"PERM", "Industry"=>"MIS", "Employer"=>"ProSensing INC", "LastUpdated"=>"08 May 2009", "Duration"=>"FT", "TravelPreference"=>"0"}, {"CandidateResumeID"=>"62423898", "City"=>"Honolulu", "CandidateID"=>"33399272", "Country"=>"USA", "id"=>"MzMzOTkyNzI7NjI0MjM4OTg7MTI0MTc2MzYwMTsyO211ZzFIQmlyTDNqdHRmcGpkOGs4YnctLQ--", "FirstName"=>"rocco", "LastName"=>"fusco", "xml:lang"=>"en-US", "State"=>"HI", "yahoo:uri"=>"http://hj.yahooapis.com/v1/Resume/MzMzOTkyNzI7NjI0MjM4O
==30123== Syscall param write(buf) points to uninitialised byte(s)
==30123== at 0x38268C0E50: __write_nocancel (in /lib64/libc-2.5.so)
==30123== by 0x38268694B2: _IO_file_write@@GLIBC_2.2.5 (in /lib64/libc-2.5.so)
==30123== by 0x38268693C5: _IO_do_write@@GLIBC_2.2.5 (in /lib64/libc-2.5.so)
==30123== by 0x382686A821: _IO_file_xsputn@@GLIBC_2.2.5 (in /lib64/libc-2.5.so)
==30123== by 0x382685FBFA: fwrite (in /lib64/libc-2.5.so)
==30123== by 0x432294: io_fwrite (io.c:495)
==30123== by 0x437D4A: io_write (io.c:578)
==30123== by 0x41A35C: rb_call0 (eval.c:5847)
==30123== by 0x41B077: rb_call (eval.c:6094)
static void setDefaultAllocator( TidyBuffer* buf )
{
buf->allocator = &TY_(g_default_allocator);
}
/* Avoid thrashing memory by doubling buffer size
** until larger than requested size.
buf->allocated is bigger than allocSize+1 so that a trailing null byte is
always available.
*/
def test_synch_user_repository_convs_grabs_images
conv = convs(:conv207_private)
conv.body = '<img src="http://test.host/doc/show/4"/>'
conv.synch_user_repository_convs
conv.reload
assert conv.body =~ /convs\/207/, "convs string wasn't appended to image"
end
File.read("svns.txt").split("\n").map{|l| l.split(/\s/)}.each{|pid| `kill -9 #{pid[0]}`}
CURB!
irb(main):010:0> req = Net::HTTP.new("google.com", 80)
=> #<Net::HTTP google.com:80 open=false>
irb(main):011:0> curl = Curl::Easy.perform("http://www.google.com")
=> #<Curl::Easy:0x876ba58>
irb(main):012:0> Benchmark.bm do |x|
irb(main):013:1* x.report("net/http"){20.times{req.start{|http| http.get("/")}}}
irb(main):014:1> x.report("curb"){20.times{curl.perform}}
irb(main):015:1> end
user system total real
===================================================================
--- lib/widgets/external_widgets.rb (revision 13560)
+++ lib/widgets/external_widgets.rb (working copy)
@@ -50,7 +50,8 @@
(defined?(@@opts) && @@opts) || {}
end
def self.set(opts={})
@@opts = opts.clone
end
end