Public Gists by notahat

Gravatar
Thu Nov 05 17:28:38 -0800 2009
1
2
3
if RUBY_VERSION.starts_with?("1.8")
 
  # This is a partial implementation of Fibers for Ruby 1.8 (they're normally
Gravatar
Wed Oct 14 22:48:25 -0700 2009
1
2
3
This is a note stemming from a Twitter conversation with Alexis Richardson (@monadic). I was
complaining that the message queueing software I'd looked at solved a performance problem I
didn't have, and ignored an admin problem I did have. He challenged me to write up my
Gravatar
Tue Oct 13 14:48:53 -0700 2009
1
2
3
class MessageQueue < ActiveRecord::Base
  ...
end
Gravatar
Thu Sep 17 21:55:54 -0700 2009
1
2
3
# This is my home-grown solution for implementing the model end of
# a multi-step form in Rails.
#
gist: 124652 Example of how Machinist ha...
Gravatar
Fri Jun 05 19:59:35 -0700 2009
1
2
3
# Let's say we have some really simple models for a blog. (I'm using
# DataMapper here, but Machinist works exactly the same way with ActiveRecord.)
 
Gravatar
Fri Jun 05 18:54:54 -0700 2009
1
2
3
      it "should support single-table inheritance" do
        Person.blueprint { name "Fred" }
        Admin.blueprint { name "Bill" }
Gravatar
Tue May 26 05:18:37 -0700 2009
1
2
3
module SExpression
  
  def self.parse(s)
Gravatar
Sun May 24 02:51:46 -0700 2009
1
2
3
#include <AikoEvents.h>
 
using namespace Aiko;
Gravatar
Thu May 21 04:10:23 -0700 2009
1
2
3
require 'test/unit'
require 'enumerator'
 
Gravatar
Wed May 13 19:40:26 -0700 2009
1
2
3
#include <avr/interrupt.h>
 
union TimerCounter {
Gravatar
Fri Mar 27 02:56:33 -0700 2009
1
2
3
                             My traceroute [v0.75]
maxwell.local (0.0.0.0) Fri Mar 27 20:56:20 2009
Keys: Help Display mode Restart statistics Order of fields quit
Gravatar
Thu Feb 05 15:07:45 -0800 2009
1
2
3
The Ruby daemons gem, as used by daemontools, does this to restart daemons:
 
  @group.stop_all
Gravatar
Tue Jan 13 18:35:54 -0800 2009
1
2
3
~$ sudo gem install lachlanhardy-gitjour
Successfully installed lachlanhardy-gitjour-8.1.0
1 gem installed
Gravatar
Mon Dec 22 13:33:45 -0800 2008
1
2
3
value = "Don T Alias"
first_name, last_name = value.reverse.split(' ', 2).reverse.collect(&:reverse)
first_name = first_name.to_s
Gravatar
Wed Oct 08 23:10:52 -0700 2008
1
2
3
Why is http://gist.github.com/15704 invalid HTML?
 
The width of each column is specified as 50%. Section 10.2 of the CSS2 spec tells us:
Gravatar
Wed Oct 08 22:21:38 -0700 2008
1
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Gravatar
Sun Oct 05 20:37:24 -0700 2008
1
2
3
# This is a teaser for a plugin I'm working on to provide an alternative
# to ActiveRecord fixtures.
#
Gravatar
Fri Sep 05 08:41:52 -0700 2008
1
2
3
% ruby --version
ruby 1.8.6 (2007-09-23 patchlevel 110) [i686-darwin9.0.0]