Public Gists by benschwarz

Gravatar
Sat Nov 28 17:48:34 -0800 2009
1
2
3
module Registerable
  @@registered = {}
  
Gravatar
Thu Nov 26 02:44:07 -0800 2009
1
2
3
# Use on_change :property { # do stuff here }
# to make changes to models after a property has been changed
 
Gravatar
Tue Nov 24 16:40:01 -0800 2009
1
2
3
uninitialized constant Encoding (NameError)
  /Users/ben/.gem/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:443:in `load_missing_constant'
  /Users/ben/.gem/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `const_missing'
Gravatar
Tue Nov 17 17:06:19 -0800 2009
1
http://ujihisa.blogspot.com/2009/06/rubygems-best-practice.html
Gravatar
Sat Nov 07 19:05:20 -0800 2009
1
2
3
bash-3.2$ rvm 1.8.7%rbx ; gem install rake --trace
ERROR: While executing gem ... (OptionParser::InvalidOption)
    invalid option: --trace
Gravatar
Sun Sep 20 23:24:44 -0700 2009
1
2
3
A few things left to do:
 
* Ability to add default options for each PDF, rather than having to pass it to each generate_* method call
Gravatar
Tue Sep 15 21:14:27 -0700 2009
1
2
3
# Run the given block +num+ times and then print out the mean, median, min,
# max, and stddev of the run. For example:
#
Gravatar
Tue Sep 15 18:30:33 -0700 2009
1
2
3
# Run the given block +num+ times and then print out the mean, median, min,
# max, and stddev of the run. For example:
#
Gravatar
Fri Sep 11 03:13:53 -0700 2009
1
2
Ϟ macruby demo.rb
undefined method `gem' for main:TopLevel (NoMethodError)
Gravatar
Mon Aug 24 00:25:11 -0700 2009
1
2
3
Poor Man's Deploy
=================
 
Gravatar
Thu Aug 20 05:26:15 -0700 2009
1
2
3
$("form input[name=_method][value=delete]").parents("form").submit(function (event){
  if(!confirm("Are you sure?")) {
    event.preventDefault();
Gravatar
Thu Aug 06 05:41:55 -0700 2009
1
2
3
>> require 'moneta/memcache'
=> true
>> Moneta::Memcache
Gravatar
Tue Aug 04 23:32:29 -0700 2009
1
FakeWeb.register_uri(:get, %r(google(.*)geo), :response => File.join(SPEC_ROOT, 'support', 'fakeweb', 'geo')) unless FakeWeb.registered_uri?(:get, "http://maps.google.com/geo")
Gravatar
Tue Jul 07 20:16:26 -0700 2009
1
2
3
# Rails app generator
 
# Remove unnecessary Rails files
Gravatar
Wed Jul 01 21:57:47 -0700 2009
1
2
3
# Download images from ffffound and add to random desktop images.
# Install:
# Add to cron
Gravatar
Tue Jun 23 22:27:55 -0700 2009
1
2
3
// Found on my desktop from early 07'
 
// JSON ActiveResource - REST Implementation
Gravatar
Sun Jun 14 19:28:13 -0700 2009
1
2
3
# The only working install (on mac) I can get to run of libmemcached and e.weaver's memcached gem
wget http://blog.evanweaver.com/files/libmemcached-0.25.14.tar.gz
tar -xzvf libmemcached-0.25.14.tar.gz
Gravatar
Sun May 24 05:07:36 -0700 2009
1
2
3
# Usage
require 'hookr'
 
Gravatar
Wed May 20 18:55:22 -0700 2009
1
2
3
module Locality::Search
  
  def self.included(base)
Gravatar
Wed May 20 06:15:15 -0700 2009
1
2
3
require File.join(File.dirname(__FILE__), 'boot')
 
Rails::Initializer.run do |config|