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-
View all 102 lines
## irb [ruby] >> Process.fork do ?> m = OSA.app('Mail') >> end => 87041
November 08, 2007
10:36AM EDT
by kjell-
View all 29 lines
#!/usr/bin/env ruby %w(rubygems chronic rbosa).each {|lib| require lib} @itunes = OSA.app('iTunes')
July 24, 2007
11:34AM EDT
by kjell-
View all 7 lines
#!/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-
View all 14 lines
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-
View all 8 lines
# 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-
View all 8 lines
>> 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-
View all 7 lines
class Object def true?; self ? true : false; end def false?; !true? end end
December 16, 2006
11:30AM EDT
by kjell-
View all 88 lines
!! 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-
View all 17 lines
## 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-
View all
261 lines
Includes file attachment.
!! 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-
View all
24 lines
Includes file attachment.
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-
View all
12 lines
Includes file attachment.
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-
View all 26 lines
[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
