Mensch font, Webkit, Chrome, Firefox, Kaleidoscope, iTerm, Transmit, Coda, Sublime Text, Sequel Pro,
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
# this works with oauth 0.5.1 | |
client = OAuth2::Client.new(CLIENT_ID, CLIENT_SECRET, | |
:authorize_url => "/o/oauth2/auth", | |
:token_url => "/o/oauth2/token", | |
:site => 'https://accounts.google.com/') | |
redirect_uri = "#{SERVER_URL}/oauth2callback" | |
get '/auth' do |
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
module ActionController | |
class Metal | |
attr_internal :cached_content_for | |
end | |
module Caching | |
module Actions | |
def _save_fragment(name, options) | |
return unless caching_allowed? |
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 BaseModel < CouchRest::ExtendedDocument | |
include ActiveModel::Dirty | |
use_database DB | |
def initialize(passed_keys={}, options={}) | |
super(passed_keys, options) | |
@changed_attributes = {} | |
end | |
class <<self |
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 "rubygems" | |
require "faker" | |
require "couchrest" | |
DB = CouchRest.database!('http://127.0.0.1:5984/contacts') | |
class Contact < CouchRest::ExtendedDocument | |
use_database DB | |
property :first_name |
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
<% if can? :destroy, @comment %> | |
<%= link_to 'Delete', comment_path({:id => comment.id}), :confirm => "Are you sure?", :method => :delete %> | |
<% 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
require 'couchrest' | |
class Log < CouchRest::ExtendedDocument | |
database = CouchRest.new | |
database.default_database = "logger" | |
use_database database.default_database | |
property :response_time | |
property :created_at |
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
{ | |
"all": { | |
"map": "function(doc) {\n if (doc['couchrest-type'] == 'BlogUser') {\n emit(doc['_id'],1);\n }\n }" | |
}, | |
"by_account": { | |
"map": "function(doc) {\n if ((doc['couchrest-type'] == 'BlogUser') && doc['account']) {\n emit(doc['account'], null);\n }\n}\n" | |
} | |
} |
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
# Installing Rails 3.0.pre in it's own gemset using rvm. | |
# I use Ruby Enterprise Edition for rails development. | |
# You might want to replace ree with Your Favorite Ruby Implementation(tm) | |
rvm use ree%rails3 # Create new gemset called rails3. | |
gem install rake rack test-spec thor sqlite3-ruby # Get some gems we'll need (rails3 gemset should be empty) | |
git clone git://github.com/rails/rails.git && cd rails # Get rails source. | |
git submodule init && git submodule update # Get git dependencies. | |
rake package && gem install -f */pkg/*.gem pkg/*.gem # Create gems and install | |
cd arel && thor :build && thor :install && cd ../.. # Install arel |
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
SC.PoolableClass = { | |
isPooled: YES, | |
_objectPool: [], | |
maxPoolSize: 100, | |
_pool_default_concat_values: {}, // default values for concatenated properties | |
create: function() { | |
// first, check pool |
NewerOlder