Public Gists by codeape

Gravatar
Mon Nov 09 19:54:25 -0800 2009
1
2
3
=rounded_corners(!radius)
  :border-radius = !radius
  :-moz-border-radius = !radius
Gravatar
Sun Nov 01 16:56:23 -0800 2009
1
2
3
What did you do to get good at Rails?
Who taught you what you know?
Do you have any fond (or not so fond) memories of your learning experiences?
Gravatar
Thu Sep 17 00:02:38 -0700 2009
1
2
3
#!/usr/bin/env ruby
 
require 'rubygems'
Gravatar
Mon Jun 29 20:54:20 -0700 2009
1
2
3
[Parabox] dan:~$ cat ~/.gemrc
---
:verbose: true
Gravatar
Thu Jun 04 20:44:41 -0700 2009
1
2
3
class Report
  # ENGINEERING MACHINATIONS
  machine(:status, :field_name => "status") do
Gravatar
Thu May 28 20:54:37 -0700 2009
1
2
3
  // the DOM is wacky
  targetTabHeight: function() {
 
Gravatar
Mon May 25 20:57:49 -0700 2009
1
2
3
# named_scope :between, lambda {|start_date, end_date, field|
# { :conditions => ["\"#{field}\" >= ? AND \"#{field}\" <= ?", start_date, end_date] }
# }
Gravatar
Mon Apr 27 17:51:14 -0700 2009
1
2
3
namespace :db do
 
  desc "Generates ownership queries"
Gravatar
Mon Apr 27 17:35:18 -0700 2009
1
2
3
# assuming the following columns in `things`
#
# children_counter_cache :integer
Gravatar
Wed Apr 08 22:52:50 -0700 2009
1
2
3
def v1(value)
  value || "-"
end
Gravatar
Thu Mar 26 17:44:45 -0700 2009
1
2
3
namespace :db do
  desc "Migrate database from MySQL to PostgreSQL"
  task :translate => :environment do
Gravatar
Mon Mar 23 21:16:32 -0700 2009
1
2
3
def self.retrieve_capture_fields(the_page, type_of_capture)
  case the_page
    when Event then retrieve_capture_data(type_of_capture, the_event_or_hero_page)
Gravatar
Mon Mar 23 20:49:08 -0700 2009
1
2
3
def self.determine_if_this_is_an_event_or_hero_page_mode(args)
  if args[:event_url]
    "event"
Gravatar
Thu Mar 19 19:22:46 -0700 2009
1
2
3
def donate
    @heroPage = HeroPage.search_url(params[:url], DateTime.now)
    unless @heroPage
Gravatar
Thu Mar 12 22:16:49 -0700 2009
1
2
3
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.1/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant ActiveRecord::Validations (NameError)
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.1/lib/active_support/dependencies.rb:80:in `const_missing'
from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.1/lib/active_record/base.rb:3140
Gravatar
Wed Mar 04 18:15:32 -0800 2009
1
2
3
## application.js
 
  trigger_visibility_callbacks = function() {
Gravatar
Thu Jan 29 18:53:19 -0800 2009
1
2
3
class Foo < ActiveRecord::Base
end
 
Gravatar
Wed Jan 21 16:48:13 -0800 2009
1
2
3
def normalise_duration(duration_string)
  seconds, minutes, hours = duration_string.split(/[:.]/).reverse.map(&:to_i)
   
Gravatar
Sun Aug 24 17:28:31 -0700 2008
1
2
3
ActionController::MethodNotAllowed (Only get and post requests are allowed.):
    /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/routing/recognition_optimisation.rb:65:in `recognize_path'
    /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/routing/route_set.rb:384:in `recognize'
Gravatar
Wed Aug 13 08:21:39 -0700 2008
1
2
3
<% @sections.each do |section| %>
  <h2><%= section_name(section) %></h2>