A simple paragraph with
a line break, some emphasis and a link
- an item
- and another
- one
- two
* Member directory with photos | |
* Messages | |
** Multiple categories | |
** Email subscription | |
** Unsubscribe from a category | |
** Mute a thread if you're not interested | |
** Proper threading in Gmail | |
** Proper preview snippet in Gmail | |
** Take a convo off-list | |
** Reply to original author |
Impression.where("created_at>=? and created_at<=?",7.days.ago,Time.now).select("impressionable_id").group("impressionable_id").order("count_impressionable_id DESC").limit(7).count |
describe TournamentRegistration do | |
it "should parameterize itself with id" do | |
registration = Factory.create(:tournament_registration, :team_name => "Mighty Badgers") | |
registration.to_param.should == "#{registration.id}-mighty-badgers" | |
end | |
end |
#!/usr/bin/env ruby | |
require 'benchmark' | |
TIMES_TO_REPEAT = 10_000_000 | |
class SpecialString < String; end | |
Benchmark.bmbm do|b| | |
b.report("''.to_s") do | |
str = '' |
A simple paragraph with
a line break, some emphasis and a link
class HtmlTag < Parslet::Parser | |
root(:tag) | |
rule(:tag) do | |
( open_tag | close_tag | self_closing_tag ).as(:html_tag) | |
end | |
rule(:self_closing_tag) { str("<") >> tag_name >> attributes? >> (spaces? >> str("/")) >> str(">") } | |
rule(:open_tag) { str("<") >> tag_name >> attributes? >> str(">") } | |
rule(:close_tag) { str("</") >> tag_name >> str(">") } |
class ActionView::Helpers::InstanceTag | |
DEFAULT_FIELD_OPTIONS.delete("size") | |
DEFAULT_TEXT_AREA_OPTIONS.delete("rows") | |
DEFAULT_TEXT_AREA_OPTIONS.delete("cols") | |
end |
Need a Rails plugin that can also be used as just a jQuery library.
<script> | |
function hightlightPaymentMethodLogo(payment_method_id) { | |
if(payment_method_id > 0) { | |
var payment_method_logo_id = 'payment_method_logo_' + payment_method_id; | |
var obj = document.getElementById(payment_method_logo_id); | |
obj.style['border-style'] = "solid"; | |
obj.style['border-width'] = "2px"; | |
obj.style['-moz-border-radius'] = "6px"; | |
obj.style['-webkit-border-radius'] = "6px"; | |
obj.style['border-color'] = "#00ff00"; |
$ rails c | |
1.9.2p320 :007 > ActiveRecord::Base.connection.send :postgresql_version | |
=> 90102 | |
$ rake staging console | |
ActiveRecord::Base.connection.send :postgresql_version | |
=> 80311 | |
$ rake production console | |
ActiveRecord::Base.connection.send :postgresql_version |