Skip to content

Instantly share code, notes, and snippets.

View eltiare's full-sized avatar

Jeremy Nicoll eltiare

View GitHub Profile
/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'
from /srv/www/photo-op/gems/gems/merb_datamapper-1.0.12/lib/merb_datamapper.rb:60:in `run'
from /srv/www/photo-op/gems/gems/merb-core-1.0.12/lib/merb-core/bootloader.rb:99:in `run'
from /srv/www/photo-op/gems/gems/merb-core-1.0.12/lib/merb-core/server.rb:172:in `bootup'
from /srv/www/photo-op/gems/gems/merb-core-1.0.12/lib/merb-core/server.rb:42:in `start'
from /srv/www/photo-op/gems/gems/merb-core-1.0.12/lib/merb-core.rb:170:in `start'
from /srv/www/photo-op/gems/gems/merb-core-1.0.12/bin/merb:11
from /opt/ruby-enterprise/bin/merb:19:in `load'
class SuperParent
include DataMapper::Resource
property :id, Serial
has n, :parents
end
class Parent
include DataMapper::Resource
property :id, Serial
@eltiare
eltiare / gist:105103
Created May 1, 2009 15:44
binary42 bio.txt
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 unive
(in /usr/local/src/do/do_mysql)
To cross-compile, install rake-compiler (gem install rake-compiler)
rm -r coverage
/usr/local/src/do/do_mysql/lib/do_mysql_ext.so: libmysqlclient.so.16: cannot open shared object file: No such file or directory - /usr/local/src/do/do_mysql/lib/do_mysql_ext.so (LoadError)
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/src/do/do_mysql/lib/do_mysql.rb:10
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/src/do/do_mysql/spec/spec_helper.rb:29
from ./spec/integration/do_mysql_spec.rb:4:in `require'
(in /usr/local/src/do/do_mysql)
To cross-compile, install rake-compiler (gem install rake-compiler)
rm -r doc
rm -r pkg
/usr/local/bin/ruby extconf.rb
checking for mysql.h... yes
checking for main() in -lmysqlclient... yes
checking for mysql_query()... yes
checking for mysql_ssl_set()... yes
creating Makefile
dlocate libmysqlclient
libmysqlclient15-dev: /.
libmysqlclient15-dev: /usr
libmysqlclient15-dev: /usr/include
libmysqlclient15-dev: /usr/include/mysql
libmysqlclient15-dev: /usr/include/mysql/mysql.h
libmysqlclient15-dev: /usr/include/mysql/mysql_com.h
libmysqlclient15-dev: /usr/include/mysql/mysql_time.h
libmysqlclient15-dev: /usr/include/mysql/my_list.h
libmysqlclient15-dev: /usr/include/mysql/my_alloc.h
require 'socket'
require 'base64'
class SSMTP < TCPSocket
def self.start(*args)
s = new(*args[0..1])
s.start(*args[2..5])
yield s
s.close
end
# Please note that I adapted this code from an ancient (5 year old) article on IBM's site.
# I Forget the URL...
require "socket"
class ChatServer
def initialize( port )
@sockets = []
@port = port
end # initialize
def run
def urlize_parameters(obj, prefix = '')
case obj
when Hash: obj.map { |k,v| urlize_parameters(v, prefix.blank? ? k : "#{prefix}[#{k}]")}.join('&')
when Array: obj.map { |v| urlize_parameters(v, "#{prefix}[]")}.join('&')
else "#{prefix}=#{obj}"
end
end
#!/usr/bin/env ruby
# A quick and dirty image combiner for CSS sprites
# Name your files something along the lines of file_name_1.jpg (all with same extensions,
# including casing if important on your OS) and this script will combine them in order,
# create a directory named 'sprites' and put the resulting CSS sprite image in that dir.
# Run this script in the directory that contains files that you want to combine. Takes
# one argument, specifying the highest number that the script will go up to. It defaults to 3.
# So if you have # 4 images for each sprite, simply pass the number 4 to the script like so:
# ./spriter.rb 4