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
/** SELECT VALUES FOR SECTION 'Vanity Tops' AND FILTER 'AVAILABLE_COLORS' **/ | |
SELECT VALUE AS NAME, | |
VALUE AS VALUE, | |
Count(VALUE) AS COUNT | |
FROM (SELECT product_id, | |
VALUE, | |
position | |
FROM (SELECT pa.product_id AS product_id, | |
pa.position AS position, | |
Substr(pa.VALUE,Instr(pa.VALUE,'~') + 1,Length(pa.VALUE)) AS VALUE |
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
# Replace "app/controllers" for the kind of thing you are looking for | |
# A list of available items can be found in rails/railties/lib/rails/engine/configuration.rb#line39 | |
Rails.configuration.paths["app/controllers"].expanded.inject([]) do |controllers, dir| | |
controllers += Dir["#{dir}/**/*_controller.rb"].map do |file| | |
file.gsub("#{dir}/", "") | |
.gsub(".rb", "") | |
.camelize | |
.constantize | |
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
diff --git a/lib/moo_moo/base.rb b/lib/moo_moo/base.rb | |
index 43ed22a..f20a36e 100644 | |
--- a/lib/moo_moo/base.rb | |
+++ b/lib/moo_moo/base.rb | |
@@ -2,6 +2,29 @@ module MooMoo | |
class Base | |
attr_reader :host, :key, :user, :pass, :port | |
+ # Register an api service for the current class. | |
+ # |
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
E, [2012-02-21T20:30:12.434214 #4624] ERROR -- : app error: Net::HTTPOK#read_body called twice (IOError) | |
E, [2012-02-21T20:30:12.434323 #4624] ERROR -- : /home/fabio/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/net/http.rb:2704:in `read_body' | |
E, [2012-02-21T20:30:12.434383 #4624] ERROR -- : /home/fabio/dev/----/---/lib/---/net_http_client.rb:45:in `each' | |
E, [2012-02-21T20:30:12.434442 #4624] ERROR -- : /home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/activerecord-3.2.1/lib/active_record/query_cache.rb:46:in `each' | |
E, [2012-02-21T20:30:12.434501 #4624] ERROR -- : /home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:424:in `each' | |
E, [2012-02-21T20:30:12.434557 #4624] ERROR -- : /home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/actionpack-3.2.1/lib/action_dispatch/middleware/body_proxy.rb:27:in `method_missing' | |
E, [2012-02-21T20:30:12.434613 #4624] ERROR -- : /home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/rack-1.4.1/lib/rack/body_proxy.rb:26: |
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
<% semantic_navigation :main do |n| %> | |
<%= n.group 'Media' do %> | |
<%= n.item 'Image Gallery', :link => '/media/images', :highlights_on => '/media/videos' %> | |
<%= n.item 'Videos', :link => '/media/videos', :disabled_if => proc { true } %> | |
<%= n.item 'Contact Us' # auto links to the contact_us_path if it exists %> | |
<% 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
class PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |
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 Model | |
# model has a country_code column which stores in ISO format | |
def country | |
I18n.t(country_code) | |
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
irb | |
require 'uri' | |
require 'faraday' | |
uri = URI.parse("http://www.google.com.br") | |
response = Faraday.new(:url => uri) do |c| | |
c.params = {:a => "b"} | |
end.get.body |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 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
Country;ISO;International Phone | |
Afghanistan;AF;93 | |
Aland Islands;AX;358 | |
Albania;AL;355 | |
Algeria;DZ;231 | |
American Samoa;AS;684 | |
Andorra;AD;376 | |
Angola;AO;244 | |
Anguilla;AI;1 | |
Antarctica;AQ; |
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
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/capybara-webkit-0.10.0/lib/capybara/driver/webkit/node.rb:127:in `check_visibility' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/capybara-webkit-0.10.0/lib/capybara/driver/webkit/node.rb:36:in `select_option' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/capybara-1.1.2/lib/capybara/node/element.rb:83:in `block in select_option' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/capybara-1.1.2/lib/capybara/node/base.rb:46:in `wait_until' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/capybara-1.1.2/lib/capybara/node/element.rb:83:in `select_option' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/bundler/gems/splinter-81bbe9fa8ac9/lib/splinter/capybara/actions.rb:109:in `find_and_select_option' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/bundler/gems/splinter-81bbe9fa8ac9/lib/splinter/capybara/actions.rb:48:in `block in complete_form' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/bundler/gems/splinter-81bbe9fa8ac9/lib/splinter/capybara/form_completer.rb:41:in `each' | |
/home/fabio/.rvm/ge |
OlderNewer