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
//= require "http://gist.github.com/66568" | |
//= require "http://gist.github.com/162593" | |
<div class="tab-panel"> | |
<nav class="tabs"> | |
<ul> | |
<li href="#sect-1" tagindex="1">tab 1</li> | |
<li href="#sect-2" tagindex="2">tab 2</li> | |
<li href="#sect-3" tagindex="3">tab 3</li> | |
</ul> |
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 class="tab-panel"> | |
<nav class="tabs"> | |
<ul> | |
<li href="#sect-1" tabindex="1">tab 1</li> | |
<li href="#sect-2" tabindex="2">tab 2</li> | |
<li href="#sect-3" tabindex="3">tab 3</li> | |
</ul> | |
</nav> | |
<section id="sect-1"></section> | |
<section id="sect-2"></section> |
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 generate_canonical_link | |
prefix = '?' | |
href_attr = "#{request.env['rack.url_scheme']}://#{SERVICE_DOMAIN}#{request.env['REQUEST_PATH']}" | |
if (params[:page] && params[:page].to_i != 1) | |
href_attr += "#{prefix}page=#{params[:page]}" | |
prefix = "&" | |
end | |
if params[:query] |
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
(function($, doc) { | |
var getHTML; | |
if ('outerHTML' in doc.documentElement) { | |
getHTML = function getHTML() { | |
return $.String(this.raw.outerHTML); | |
}; | |
} else { | |
var dummy = doc.createElement('html'); | |
getHTML = function getHTML() { |
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
function t(s,d){ | |
return s.replace(/{([^}]*)}/g, function(_, p){ | |
return (typeof d[p])[0]=='f' ? d[p]() : d[p]; | |
}); | |
} |
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
brew search postgres | |
brew tap homebrew/versions | |
brew install postgresql8 |
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
require 'spec_helper' | |
describe User do | |
let(:user) { Factory(:user) } | |
context "validation" do | |
it { should have_one :purchaser } | |
it { should have_one :recipient } | |
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
class Credential | |
include ActiveModel::Validations | |
attr_accessor :screen_name, :oauth_token, :oauth_secret, :token, :description | |
validates_presence_of :screen_name, :oauth_token, :oauth_secret, :message => 'required' | |
validate :user_exists, :unless => :errors? | |
def initialize(attributes = {}) | |
attributes.each { |k, v| set_recognized_attribute(k, v) } |