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
array = [1, 2] | |
array.each_with_index do |item, index| | |
puts "LAST!" if item == array.last | |
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 ArtistSearchController < ApplicationController | |
def search | |
@title = "Search" | |
end | |
def artist | |
@title = "Similar artists" | |
logger.debug "#{params[:artist].class}" | |
unless params.nil? | |
music_request = MusicRequest.new #snake_case, not camelCase |
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
<ul> | |
<% @foo.each do |bar| %> | |
<li class="lol"> | |
STUFF: <%= bar[:stuff] %> | |
OTHER STUFF: <%= bar[:other_stuff] %> | |
</li> | |
<% end %> | |
</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
# Add rails logging to script/console like in script/server | |
# to disable it for one run do this command: | |
# | |
# RAILS_CONSOLE_LOGGING=off script/console | |
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER') && !%w{false off}.include?(ENV['RAILS_CONSOLE_LOGGING']) | |
require 'logger' | |
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT)) | |
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.9.2-rc2 > require 'sender' | |
LoadError: dlopen(/Users/artifact/.rvm/gems/ruby-1.9.2-rc2/gems/sender-1.5.3/lib/sender/sender.bundle, 9): Library not loaded: /usr/local/lib/libruby.1.9.1.dylib | |
Referenced from: /Users/artifact/.rvm/gems/ruby-1.9.2-rc2/gems/sender-1.5.3/lib/sender/sender.bundle | |
Reason: image not found - /Users/artifact/.rvm/gems/ruby-1.9.2-rc2/gems/sender-1.5.3/lib/sender/sender.bundle | |
from /Users/artifact/.rvm/gems/ruby-1.9.2-rc2/gems/sender-1.5.3/lib/sender.rb:1:in `require' | |
from /Users/artifact/.rvm/gems/ruby-1.9.2-rc2/gems/sender-1.5.3/lib/sender.rb:1:in `<top (required)>' | |
from (irb):1:in `require' | |
from (irb):1 | |
from /Users/artifact/.rvm/rubies/ruby-1.9.2-rc2/bin/irb:17:in `<main>' |
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/artifact/.rvm/rubies/ruby-1.9.2-rc2/bin/ruby extconf.rb | |
*** extconf.rb failed *** | |
Could not create Makefile due to some reason, probably lack of | |
necessary libraries and/or headers. Check the mkmf.log file for more | |
details. You may need configuration options. | |
Provided configuration options: | |
--with-opt-dir | |
--without-opt-dir | |
--with-opt-include |
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 ActionController::TestCase | |
def process_with_auto_validate(action, parameters = nil, session = nil, flash = nil, http_method = 'GET') | |
response = process_without_auto_validate(action,parameters,session,flash,http_method) | |
assert_xhtml_strict response.body unless response.redirect? or @request.xhr? or @response.content_type != 'text/html' | |
response | |
end | |
alias_method_chain :process, :auto_validate | |
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
grep -rl "ORDER BY '\w*'" . | cpio -pd ../patch/ |
NewerOlder