This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import compass/reset.sass | |
@import blueprint.sass | |
@import blueprint/modules/form.sass | |
@import blueprint/modules/liquid.sass | |
@import compass/layout.sass | |
@import compass/utilities.sass | |
@import icons.sass | |
+blueprint | |
+blueprint-typography |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
case @mtype | |
when 'Gold' | |
pmt = PN_MBR_GOLD | |
when 'Regular' | |
pmt = PN_MBR_REGULAR | |
when 'Student' | |
pmt = PN_MBR_STUDENT | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<meta name="description" content="Compass is a real stylesheet framework — not just a collection of classes. With Compass, you still use the best of breed css frameworks; adapted to make them easier to configure and apply to your semantic markup." /> | |
<meta name="keywords" content="compass, sass, haml, rails, ruby on rails, sinatra, merb, css, blueprint, 960gs" /> | |
<link href="http://compass-style.org/stylesheets/application.css?1239703540" media="screen" rel="stylesheet" type="text/css" /> | |
<title>Compass - Untangle your design</title> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Note < ActiveRecord::Base | |
belongs_to :creator, :class_name => "User", :foreign_key => :creator_id | |
# Fix DB default problem for TEXT and BINARY | |
def initialize(attributes=nil) | |
super({:body => ''}.merge(attributes || {})) | |
end | |
def to_s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from script/console production | |
>> u = Service.find(37) | |
=> #<Service id: 37, user_id: 9, url: "http://www.example.com", tiny_url: "", name: "TipMe", email: "", currency_id: 840, timezone_id: 140, locale: "en_US", verification_attempt_at: nil, verified_at: nil, tax_registration: nil, npo_registration: nil, flags: 0, created_at: "2009-02-15 22:29:50", updated_at: "2009-10-10 20:20:37", color: nil, paypal_id: "", paypal_email: "", contributors_count: 14, description: "Just give us some tips! Updated"> | |
>> u.description | |
=> "Just give us some tips! Updated" | |
Model: | |
require 'open-uri' | |
require 'hpricot' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<% form_for @service, :url => {:controller=>"recipient", :action => frmAction, :id => @service.id}, :html => { :id => 'addSiteForm', :class => 'fullForm', :multipart => true, :method => :put } do |f| -%> | |
<% unless f.error_messages.blank? %> | |
<div id="flashInfo"> | |
<%= f.error_messages %> | |
</div> | |
<% end %> | |
<div class='fieldTag'> | |
<label for='service_name'>Name:</label><br/><%= f.text_field :name %> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby-1.8.7-p174: ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.8.0] | |
rails is not installed, installing... | |
Error running 'GEM_HOME='/Users/billlazar/.rvm/gems/ruby-1.8.7-p174' GEM_PATH='/Users/billlazar/.rvm/gems/ruby-1.8.7-p174/bin:/Users/billlazar/.rvm/gems/ruby-1.8.7-p174%global/bin' BUNDLE_PATH='/Users/billlazar/.rvm/gems/ruby-1.8.7-p174' gem install rails -pre ', please check /Users/billlazar/.rvm/log/ruby-1.8.7-p174/gem.install*.log | |
rails failed to install, output has been logged to: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class KachingleMedallionWidget extends WP_Widget { | |
function KachingleMedallionWidget() { | |
$widget_ops = array('classname' => 'widget_kachingle_medallion', 'description' => __( 'Add your Kachingle Medallions') ); | |
$this->WP_Widget('KachingleMedallion', __('Kachingle Medallions'), $widget_ops); | |
} | |
/** | |
* Widget version of the Medallion code | |
**/ | |
function widget($args, $instance) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from http://github.com/marcomd/Logbook/blob/e3537af3170442b0a2cf93a5060c645643b88446/app/helpers/application_helper.rb | |
# usage example | |
# = manage_to_many_checkbox(@projects, @user, "project", 3) | |
# add to application_helper.rb | |
def manage_to_many_checkbox(collection, object, str_object_many, cols=1) | |
html = "" | |
i=0 | |
cb_style = cols == 1 ? '' : 'float:left;width: #{100/cols}%;' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails developers have long had bad experiences with fixtures for | |
# several reasons, including misuse. | |
# | |
# Misuse of fixtures is characterized by having a huge number of them, | |
# requiring the developer to maintain a lot of data and creating dependencies | |
# between tests. In my experience working (and rescuing) many applications, 80% | |
# of fixtures are only used by 20% of tests. | |
# | |
# An example of such tests is one assuring that a given SQL query with | |
# GROUP BY and ORDER BY conditions returns the correct result set. As expected, |
OlderNewer