Public Gists by eltiare

Gravatar
Wed Sep 30 15:17:43 -0700 2009
1
2
3
/srv/www/photo-op/gems/gems/merb_datamapper-1.0.12/lib/merb_datamapper.rb:61:in `run': undefined method `merge' for #<DataMapper::Model::DescendantSet:0x2534538> (NoMethodError)
from /srv/www/photo-op/gems/gems/dm-core-0.10.1/lib/dm-core/model/descendant_set.rb:33:in `each'
from /srv/www/photo-op/gems/gems/dm-core-0.10.1/lib/dm-core/model/descendant_set.rb:33:in `each'
Gravatar
Mon Aug 17 15:47:07 -0700 2009
1
2
3
class SuperParent
  include DataMapper::Resource
  property :id, Serial
gist: 105103 binary42 bio.txt
Gravatar
Fri May 01 08:44:30 -0700 2009
1
Brian Mitchell currently resides in Manhatten, though he likes to travel. He does consulting with the programming language Ruby, and he's also a ninja. Not the Rockstar-drinking-stay-up-all-night-coding type of ninja, but a slash-you-through-with-a-katana-whilst-you're-not-looking type of ninja. Brian is a recent refugee from Somalia, his family immigrating there 30 years ago but decided to move back to the states due to unpleasant conditions existing in Somalia. Brian enjoys reading books in other languages. His favorite language to read is Klingon. On the days he is feeling adventurous, he'll seek out books written _backwards_ in Klingon. Brian also likes to compose music by writing programming scripts that call random phone numbers at random intervals, record their voices, and then cut and splice the recordings into neoclassical works. He has found this quite effective as people's tones vary wildly depending on the time of day in which the phone call is made. Brian has graduated from five different universities with BS degrees ranging from Biomolecular Engineering to Computer Science. He says that his most awesome accomplishment is that he once ate 57 McDonald's french fries simultaneously without gagging.
Gravatar
Mon Apr 06 13:25:28 -0700 2009
1
2
3
(in /usr/local/src/do/do_mysql)
To cross-compile, install rake-compiler (gem install rake-compiler)
rm -r coverage
Gravatar
Mon Apr 06 13:05:55 -0700 2009
1
2
3
(in /usr/local/src/do/do_mysql)
To cross-compile, install rake-compiler (gem install rake-compiler)
rm -r doc
Gravatar
Mon Apr 06 12:53:36 -0700 2009
1
2
3
dlocate libmysqlclient
libmysqlclient15-dev: /.
libmysqlclient15-dev: /usr
Gravatar
Sun Mar 15 09:05:21 -0700 2009
1
2
3
require 'socket'
require 'base64'
class SSMTP < TCPSocket
Gravatar
Sun Mar 15 09:00:15 -0700 2009
1
2
3
# Please note that I adapted this code from an ancient (5 year old) article on IBM's site.
# I Forget the URL...
require "socket"
Gravatar
Tue Jan 27 19:14:20 -0800 2009
1
2
3
def urlize_parameters(obj, prefix = '')
   case obj
    when Hash: obj.map { |k,v| urlize_parameters(v, prefix.blank? ? k : "#{prefix}[#{k}]")}.join('&')
Gravatar
Thu Jan 22 10:16:34 -0800 2009
1
2
3
#!/usr/bin/env ruby
 
# A quick and dirty image combiner for CSS sprites
Gravatar
Wed Jan 21 10:46:16 -0800 2009
1
2
3
class MessageMailer < Merb::MailController
  include DataMapper::Validate
  extend DataMapper::Validate::ClassMethods
gist: 49680 Random charactar generator ...
Gravatar
Tue Jan 20 13:47:34 -0800 2009
1
2
chars = ('A'..'Z').to_a + ('a'..'z').to_a + ('0'..'9').to_a
str = (1..50).map { chars[rand(chars.size)] }.join
Gravatar
Mon Jan 12 21:25:52 -0800 2009
1
2
3
class Hash
  alias :old_default :default
  def default(*args)
Gravatar
Thu Dec 11 12:00:02 -0800 2008
1
2
3
Request Headers:
(Request-Line) POST /houser_requests HTTP/1.1
Host localhost:4000
Gravatar
Thu Dec 11 11:39:22 -0800 2008
1
2
3
Sample POST data (collected via Firebug):
housed 1
housed[address]
Gravatar
Fri Nov 28 22:07:21 -0800 2008
1
2
3
#This works:
 
    drop_class.class_eval do
Gravatar
Tue Nov 25 09:37:52 -0800 2008
1
2
3
class Application < Merb::Controller
  override! :url
protected
Gravatar
Mon Oct 27 10:29:49 -0700 2008
1
2
3
#I'm trying to make a dynamic router in Merb based on information in the
#database. Basically, I want the user to able to build their own URL
#"tree" with the home page being at the root. If what the user wants is
Gravatar
Thu Oct 23 09:52:03 -0700 2008
1
2
3
different prefix: "/" and "."
/opt/local/lib/ruby/1.8/pathname.rb:709:in `relative_path_from'
/opt/local/lib/ruby/gems/1.8/gems/merb-core-0.9.7/lib/merb-core/dispatch/default_exception/default_exception.rb:27:in `frame_details'
Gravatar
Thu Oct 23 08:03:01 -0700 2008
1
2
3
class Ad
  include DataMapper::Resource
  property :id, Integer, :serial => true