My Recent Pastes (14 and counting)

Pastes by kjell- (14 and counting)

Below are the 14 most recent pasties by kjell-.

November 08, 2007
10:39AM EDT
by kjell-

## irb [ruby]
>> Process.fork do
?> m = OSA.app('Mail')
>> end
=> 87041

November 08, 2007
10:36AM EDT
by kjell-

#!/usr/bin/env ruby
%w(rubygems chronic rbosa).each {|lib| require lib}

@itunes = OSA.app('iTunes')

July 24, 2007
11:34AM EDT
by kjell-

#!/usr/bin/env ruby
%w(rubygems hpricot active_support open-uri).each {|lib| require lib}

divs = Hpricot(open('http://youtube.com/debates'))/'div.aTitle'
candidate_mentions = divs.inject([]) {|candidates, div| (candidates << div.inner_html.split(',')).flatten}

June 01, 2007
11:23AM EDT
by kjell-

Tag.find(:all, 
      :select => 'tags.*, count(*) as tag_popularity',
      :limit => options[:limit] || 10,
      :joins => "JOIN taggings ON taggings.tag_id = tags.id
                 JOIN groups   ON groups.id       = taggings.taggable_id

February 17, 2007
12:13AM EDT
by kjell-

# why does this
<%= link_to_remote 'destroy', :url => workout_url(workout), :method => :delete, :confirm => "really?" %>

# which generates this html
<a onclick="if (confirm('really?')) { new Ajax.Request('http://fidness/workouts/30', {asynchronous:true, evalScripts:true, method:'delete'}); }; return false;" href="#">destroy</a>

February 03, 2007
11:11PM EDT
by kjell-

>> TzTime.zone = TZInfo::Timezone._load('UTC')
=> #<TZInfo::LinkedTimezone: UTC>
>> TzTime.now
=> 2007-02-04 03:20:25 UTC
>> TzTime.at(Time.now)

February 03, 2007
8:55PM EDT
by kjell-

class Object
  def true?; self ? true : false; end
  def false?; !true? end
end

December 16, 2006
11:30AM EDT
by kjell-

!! backs up files with rsync to strongspace, assuming that you have ssh keys set up.

#!/usr/bin/ruby

class Strongspace

December 05, 2006
9:05PM EDT
by kjell-

## question

:disable_with is breaking my remote_form_for and making it work just like a normal form. Shouldn't this work?

## template

November 11, 2006
4:50PM EDT
by kjell-

!! I seem to be falling into an endless loop of DEPRECATION WARNINGS!!!
!! It happens when rails tries to render an error template, I'm not sure why.
!! I'm not using any of the @request, @attributes, etc. instance variables, but the accessor methods throughout.
!! Anyone have an idea?

November 11, 2006
12:05AM EDT
by kjell-

Loading development environment.
>> ActiveRecord::Schema.define do
?> add_column :performances, :created_at, :datetime
>> end
-- add_column(:performances, :created_at, :datetime)

October 23, 2006
9:40PM EDT
by kjell-

require 'rubygems'
require 'ruby-growl'

growl = Growl.new("localhost", "Historiographer", ['pages scribed'])
growl.notify('pages scribed', '5 of them', 'sweet')

October 16, 2006
11:11PM EDT
by kjell-

[me@textdrive:/path/fidness/current] % script/server --port=8028
** You have sendfile installed, will use that to serve files.
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application started on http://0.0.0.0:8028
=> Call with -d to detach

October 16, 2006
10:46PM EDT
by kjell-

testing.