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
git filter-branch -f --index-filter 'git update-index --remove public/images/posters/fc1cc0358623559b6935b22e56d136a3.jpg' | |
git filter-branch -f --index-filter 'git update-index --remove public/images/posters/f9dea1841c49c481ea6de11ad37b7c92.jpg' | |
. | |
. | |
. | |
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune | |
git push --force --verbose --dry-run | |
git push --force |
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 Movie < ActiveRecord::Base | |
acts_as_taggable | |
has_one :download, :as => :resource, :dependent => :destroy | |
has_attached_file :poster, :styles => {:medium => "300x300>", :thumb => "100x100>"} | |
before_validation :download_remote_image, :if => :image_url_provided? | |
validates_associated :download | |
validates_presence_of :title | |
validates_numericality_of :year, :allow_nil => 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
/Users/hornairs/.rvm/gems/ruby-1.9.2-head@rails3/gems/actionpack-3.0.0.beta3/lib/action_view/helpers/url_helper.rb:30:in `url_options' | |
/Users/hornairs/.rvm/gems/ruby-1.9.2-head@rails3/gems/actionpack-3.0.0.beta3/lib/action_dispatch/routing/url_for.rb:131:in `url_for' | |
/Users/hornairs/.rvm/gems/ruby-1.9.2-head@rails3/gems/actionpack-3.0.0.beta3/lib/action_view/helpers/url_helper.rb:107:in `url_for' | |
/Users/hornairs/.rvm/gems/ruby-1.9.2-head@rails3/gems/actionpack-3.0.0.beta3/lib/action_dispatch/routing/route_set.rb:180:in `contact_path' | |
app/helpers/contacts_helper.rb:31:in `block (2 levels) in format_grid!' | |
vendor/plugins/gridify/lib/gridify/grid_finder.rb:63:in `call' | |
vendor/plugins/gridify/lib/gridify/grid_finder.rb:63:in `block (2 levels) in encode_records' | |
/Users/hornairs/.rvm/gems/ruby-1.9.2-head@rails3/gems/activemodel-3.0.0.beta3/lib/active_model/serializers/xml.rb:186:in `call' | |
/Users/hornairs/.rvm/gems/ruby-1.9.2-head@rails3/gems/activemodel-3.0.0.beta3/lib/active_model/serializers/xml.rb:186:in `block |
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
Started GET "/work_orders/queue" for 127.0.0.1 at 2010-07-18 19:53:11 -0400 | |
SQL (1.6ms) SELECT name | |
FROM sqlite_master | |
WHERE type = 'table' AND NOT name = 'sqlite_sequence' | |
SQL (1.1ms) SELECT name | |
FROM sqlite_master | |
WHERE type = 'table' AND NOT name = 'sqlite_sequence' | |
SQL (1.1ms) SELECT name | |
FROM sqlite_master |
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
# model | |
class GiftIdea | |
has_many :images | |
end | |
# in the view (say app/views/gift_ideas/show.html.erb) | |
# say we are rendering html about one GiftIdea object, found in the @gift_idea variable | |
.. | |
.. | |
<div class="gift_idea"> |
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
Started GET "/product_categories/autocomplete_for_product_sub_category_name?q=ang&limit=10×tamp=1279805094583" for 130.15.105.53 at 2010-07-22 09:29:55 -0400 | |
Processing by ProductCategoriesController#autocomplete_for_product_sub_category_name as HTML | |
Parameters: {"q"=>"ang", "limit"=>"10", "timestamp"=>"1279805094583"} | |
Rendered inline template (0.6ms) | |
Completed 200 OK in 58ms (Views: 1.7ms | ActiveRecord: 7.7ms) | |
Started GET "/product_categories/autocomplete_for_product_sub_category_name?q=ang&limit=10×tamp=1279805094583" for 130.15.105.53 at 2010-07-22 09:30:05 -0400 | |
Processing by ProductCategoriesController#autocomplete_for_product_sub_category_name as HTML | |
Parameters: {"q"=>"ang", "limit"=>"10", "timestamp"=>"1279805094583"} |
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 build_role(&block) | |
@role = Role.new | |
self.instance_eval &block if block_given? | |
r = @role | |
@role = nil | |
r | |
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
Questions: do you always need to have m or can you just use a helper method where you get the number of elements in a, that way you limit the number of parameters you pass always? | |
1. More on list intersections | |
Algorithm: commonElementsList( a, m, b, n) | |
Input: Two arrays, a and b, with m and n distinct String elements respectively | |
Output: A list of String elements common to both arrays | |
function commonElementsList( a, m, b, n) { | |
if( listIntersection( a, m, b, n ) > 0 ) |
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
User | |
- has_many :end_of_day_reports | |
Quote | |
- has_and_belongs_to_many :end_of_day_reports | |
- has_many :time_reports | |
EndOfDayReport | |
- has_and_belongs_to_many :quotes | |
- belongs_to :user |
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 Toto | |
module Template | |
def to_html page, config, &blk | |
path = ([:layout, :repo].include?(page) ? Paths[:templates] : Paths[:pages]) | |
config[:to_html].call(path, page, self, blk) | |
end | |
end | |
end |
OlderNewer