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
#!/bin/bash | |
# From: https://github.com/heroku/heroku-buildpack-metrics/blob/master/.profile.d/heroku-metrics-daemon.sh | |
setup_metrics() { | |
# don't do anything if we don't have a metrics url. | |
if [[ -z "$HEROKU_METRICS_URL" ]] || [[ "${DYNO}" = run\.* ]]; then | |
return 0 | |
fi | |
STARTTIME=$(date +%s) |
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
URL goes like this: | |
http://localhost:3000/admin/photos?utf8=%E2%9C%93&tag=6 | |
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 Event < ActiveRecord::Base | |
belongs_to :owner, class_name: 'User', foreign_key: 'user_id' | |
belongs_to :place | |
has_many :photos, as: :parent | |
validates_presence_of :name, :owner | |
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
new_photos.each do |p| | |
Photo.create(:filename => p, :version => params[:version].to_i+1, :client_id => params[:client_id].to_i) | |
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
@users = User.where(:page_owner => true).order("updated_at DESC").limit(100) if params[:page_owner] | |
@users = User.where(:page_owner_request => true}.order("updated_at DESC").limit(100) if params[:page_owner_request] | |
@users = User.where(:deleted => true}.order("updated_at DESC").limit(100) if params[:deleted] | |
@users = @users || User.all |
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/rafaeloliveira/Development/Rails/sharespot-production/app/assets/stylesheets", "/Users/rafaeloliveira/Development/Rails/sharespot-production/public/assets"], | |
["/Users/rafaeloliveira/.rvm/gems/ruby-1.9.2-p290@r310totem-simpleforms/gems/compass-0.12.1/frameworks/blueprint/stylesheets", "/Users/rafaeloliveira/Development/Rails/sharespot-production/public/assets/blueprint"], | |
["/Users/rafaeloliveira/.rvm/gems/ruby-1.9.2-p290@r310totem-simpleforms/gems/compass-0.12.1/frameworks/compass/stylesheets", "/Users/rafaeloliveira/Development/Rails/sharespot-production/public/assets/compass"] | |
] |
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
production: | |
app: xxxxxxxxx | |
stack: bamboo-ree-1.8.7 | |
config: | |
BUNDLE_WITHOUT: "development:test" | |
GOOGLE_ANALYTICS: "xxxxxxxxxxxxxx" | |
PUSHER_SOCKET_URL: "xxxxxxxxxxxxxx" | |
PUSHER_URL: "xxxxxxxxxxxxxx" | |
RACK_ENV: "production" | |
WEBSOLR_URL: "xxxxxxxxxxxxxx" |
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
=> Booting WEBrick | |
=> Rails 3.1.0 application starting in development on http://0.0.0.0:3000 | |
=> Call with -d to detach | |
=> Ctrl-C to shutdown server | |
Exiting | |
/Users/rafaeloliveira/.rvm/gems/ruby-1.8.7-p352@rails310/gems/activerecord-3.1.0/lib/active_record/base.rb:1082:in `method_missing': undefined local variable or method `acts_as_messageable' for #<Class:0x108d1d428> (NameError) | |
from /Users/rafaeloliveira/Development/Rails/mural/hollow/app/models/user.rb:22 | |
from /Users/rafaeloliveira/.rvm/gems/ruby-1.8.7-p352@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:456:in `load' | |
from /Users/rafaeloliveira/.rvm/gems/ruby-1.8.7-p352@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:456:in `load_file' | |
from /Users/rafaeloliveira/.rvm/gems/ruby-1.8.7-p352@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in' |
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
date_start = Time.parse('11/08/2015').beginning_of_day | |
date_end = Time.parse('11/08/2015').end_of_day | |
created_at_day_tz = "date(created_at AT TIME ZONE \'UTC\' | |
AT TIME ZONE \'#{Time.zone.tzinfo.identifier}\')" | |
users = User.where("users.created_at BETWEEN ? AND ?", date_start, date_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
User.find(885).created_at | |
"Sun, 31 Aug 2014 22:10:54 BRT -03:00" | |
User.select('created_at as created_at').where(id: 885) | |
[#<User id: nil, created_at: "2014-09-01 01:10:54">] | |
User.select('date(created_at) as created_at').where(id: 885) | |
[#<User id: nil, created_at: "2014-09-01">] | |
!!!!!!!!! NÃO! haha. Era pro date ser 2014-08-31. !!!!!!!!!!! |
NewerOlder