Public Gists by jmhodges

Gravatar
Wed Jun 10 15:17:36 -0700 2009
1
2
3
# this is how many Threads are currently allocated and in play
# over a 3 minute interval with the number of Threads being
# rechecked every two seconds
Gravatar
Wed Jun 10 15:02:33 -0700 2009
1
2
3
class MemoryProfiler
 
 
Gravatar
Mon Jun 01 17:16:44 -0700 2009
1
2
3
SELECT count(DISTINCT "searches".id) AS count_distinct_searches_all
  FROM "searches"
  LEFT OUTER JOIN "queries" ON "queries".id = "searches".query_id
Gravatar
Mon Jun 01 04:33:50 -0700 2009
1
2
3
# fakefs will break autoloading in your tests. You can correct this by
# eval'ing the modules you care about before requiring fakefs. One way
# to do this would be to take the top-level module (or class) that
Gravatar
Mon May 18 03:47:18 -0700 2009
1
2
3
# The code in lib/foobar.rb
require 'sinatra/base'
class Foobar < Sinatra::Base
Gravatar
Sat May 16 14:54:02 -0700 2009
1
2
3
# Nokogiri 1.2.4
 
irb(main):001:0> j = Nokogiri::HTML.parse('<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">')
Gravatar
Sat May 16 14:50:45 -0700 2009
1
2
3
# Nokogiri 1.2.3
 
→ irb -rrubygems -rnokogiri
Gravatar
Thu May 14 11:14:03 -0700 2009
1
2
3
<div style="margin-bottom: 5px; padding-left: 3em; text-indent: -3em;">
<i>
Services: <b>Grooming </b> </i>
Gravatar
Fri May 08 21:44:10 -0700 2009
1
2
3
implicit def clipMinArrayWrapper[A <% Ordered[A]](x: Array[A]) = new {
  private def smaller[B <% Ordered[B]](p: B, q: B) : B = {
    if (p < q) return(p) else return(q)
gist: 106756 print json response
Gravatar
Mon May 04 17:42:26 -0700 2009
1
2
3
#!/usr/bin/env ruby
 
require 'rubygems'
Gravatar
Tue Apr 28 13:51:33 -0700 2009
1
2
3
require 'dryopteris'
require 'test/unit'
 
Gravatar
Mon Apr 20 14:34:50 -0700 2009
1
2
3
   module ClassMethods
       def blamed
- belongs_to :creator, :class_name => 'Person'
Gravatar
Sun Apr 19 20:01:27 -0700 2009
1
2
3
# Requirements: Pass the unit tests at the bottom (in a non-trivial
# way) and be cleanly translatable to Java. That means no block and
# yield magic allowed nor setting values in the condition statements
Gravatar
Tue Mar 10 21:51:40 -0700 2009
1
2
3
 /usr/bin/g++-4.2 -DHAVE_CONFIG_H -I../.. -I../.. -I/opt/local/include -Wall -Wextra -pedantic -Wundef -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wredundant-decls -Wno-long-long -Wstrict-aliasing -Wshadow -O3 -ggdb3 -std=gnu++98 -Wno-effc++ -MT binary_log.pb.lo -MD -MP -MF .deps/binary_log.pb.Tpo -c binary_log.pb.cc -fno-common -DPIC -o .libs/binary_log.pb.o
In file included from /opt/local/include/google/protobuf/unknown_field_set.h:44,
                 from /opt/local/include/google/protobuf/generated_message_reflection.h:44,
Gravatar
Wed Feb 18 16:24:47 -0800 2009
1
2
3
  1) Failure:
test_bad_document_calls_error_handler(Nokogiri::XML::SAX::TestParser) [./test/xm
 
Gravatar
Fri Jan 30 11:18:29 -0800 2009
1
2
3
# From http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/256730
module Endian
  def self.big?
Gravatar
Thu Jan 29 11:58:09 -0800 2009
1
2
3
resources(:runs, :member => { :random => :get }, :identify => :escaped_name) do |run|
  authenticate do
    run.match('/pages/:page').to(:controller => :run_pages, :action => 'show').name(:page)
Gravatar
Tue Jan 20 21:58:40 -0800 2009
1
2
3
Debugger entered--Lisp error: (error "Local variables list is not properly terminated")
  signal(error ("Local variables list is not properly terminated"))
  error("Local variables list is not properly terminated")
Gravatar
Tue Jan 20 14:28:27 -0800 2009
1
2
3
class AddTimestampsToFoosAndBarsMigration < Sequel::Migration
 
 
Gravatar
Mon Jan 19 13:08:30 -0800 2009
1
2
3
class FooMigration < Sequel::Migration
  def up
     add_column :foos, :bar