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-p299 > User.all(:order => [:id.desc]).paginate(:page => 2) | |
~ SQL (1950.000ms) SELECT "id", "email", "created_at", "updated_at", "login_code", "cookie" FROM "users" ORDER BY "id" DESC | |
~ 118885 users |
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
Tasty::Application.routes.draw do | |
resources :items | |
constraints(SubDomain) do | |
namespace :store, :path => '/' do | |
resources :items | |
end | |
end | |
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
iframe.contentWindow.document.body.scrollHeight; | |
iframe.contentWindow.document.body.scrollWidth; |
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
iframe.contentWindow.addEventListener('scroll',function(e) {}); |
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
framework 'Cocoa' | |
framework 'Foundation' | |
class NotificationHandler | |
def handle(notification) | |
puts notification.name | |
puts notification.object.inspect | |
puts notification.userInfo.inspect | |
end | |
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
ruby-1.8.7-p299 > class Vehicle | |
ruby-1.8.7-p299 ?> include Mongoid::Document | |
ruby-1.8.7-p299 ?> field :horsepower | |
ruby-1.8.7-p299 ?> field :top_speed_mph | |
ruby-1.8.7-p299 ?> end | |
=> nil | |
ruby-1.8.7-p299 > Vehicle.new(:horsepower => 300, :top_speed_mph => 180).save | |
=> true |
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
# Controller, a name, plural with the word controller added to the class name | |
class ConventionsController < ApplicationController | |
# given the routes below, this will be at the URL http://localhost:3000/conventions/ | |
def index | |
# will automatically try to render a template "view" file | |
# located in app/views/conventions/index.html.erb | |
# the conventions being: app/views/(controller)/(action).(format).erb | |
end | |
# given the routes below, this will be at the URL http://localhost:3000/conventions/1 |
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
#sidebar ul.customers::-webkit-scrollbar { | |
width: 5px; | |
} | |
#sidebar ul.customers::-webkit-scrollbar-thumb:vertical { | |
margin: 5px; | |
background-color: #999; | |
-webkit-border-radius: 5px; | |
} |
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 Kermit | |
class Request | |
def initialize(url, success, failure=nil) | |
@request = NSURLRequest.requestWithURL(NSURL.URLWithString(url)) | |
@success = success | |
@failure = failure | |
# @parser = Yajl::Parser.new(:symbolize_keys => true) | |
end | |
def connection |