object.presence
is equivalent to object.present? ? object : nil
Use
region = params[:state].presence || params[:country].presence || 'US'
instead
require 'validate_entry_state' | |
describe Entry_State do | |
it "should be invalid without a number" do | |
entry_state = Entry_State.new(nil, "PR") | |
entry_state.should_not be_valid | |
end | |
it "should be invalid without a state" do | |
entry_state = Entry_State.new("123456789", nil) |
set -g default-terminal "screen-256color" | |
set -g mode-mouse on |
require 'digest/sha1' | |
require 'fileutils' | |
directories = [ | |
"SOURCE DIR 1", | |
"SOURCE DIR 2" | |
] | |
files = {} | |
directories.each do |dir_name| | |
puts "Scanning Directory: #{dir_name} " | |
Dir.glob("#{dir_name}/**/*.*") do |file_name| |
object.presence
is equivalent to object.present? ? object : nil
Use
region = params[:state].presence || params[:country].presence || 'US'
instead
require "#{Rails.root}/lib/development_mail_interceptor" | |
ActionMailer::Base.smtp_settings = { | |
:address => "smtp.gmail.com", | |
:port => 587, | |
:user_name => 'zegomesjf', | |
:password => 'euamoocomogo', | |
:authentication => 'plain', | |
:enable_starttls_auto => true | |
} |
cat ~/.gitconfig | |
[user] | |
name = José Gomes Júnior | |
email = [email protected] | |
[core] | |
excludesfile = ~/.gitignore | |
[color] | |
diff = auto | |
status = auto | |
branch = auto |
;var FooBar = (function($, window, document, undefined) { | |
'use strict'; | |
/** | |
* Constructor method | |
* | |
* @author Gustavo Franco | |
* @since 2013-06-27 | |
*/ | |
function FooBar() { |
# www.guepardolabs.com -> guepardolabs.com | |
# www.guepardolabs.com.br -> guepardolabs.com | |
# www.guepardolabs.net -> guepardolabs.com | |
# guepardolabs.com.br -> guepardolabs.com | |
# guepardolabs.net -> guepardolabs.com | |
require 'rack-rewrite' | |
use Rack::Rewrite do | |
r301 %r{.*}, 'http://guepardolabs.com$&', :if => Proc.new {|rack_env| | |
rack_env['SERVER_NAME'] != 'guepardolabs.com' | |
} |
ap c.contractor.list.first | |
[ | |
[0] "contractors", | |
[1] { | |
"contractor" => [ | |
[ 0] { | |
"contractor_id" => "xxxx", | |
"name" => "José Gomes Júnior", | |
"email" => "[email protected]", |