+-----------------------+------------------+-----------------+
| | eager load paths | auto load paths |
+-----------------------+------------------+-----------------+
| Rails 3 (development) | auto loaded | auto loaded |
| Rails 4 (development) | auto loaded | auto loaded |
| Rails 3 (production) | eager loaded | auto loaded |
| Rails 4 (production) | eager loaded | eager loaded |
+-----------------------+------------------+-----------------+
This file contains hidden or 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
Delayed::Job.where(queue: 'roundabout').where("last_error ilike ?", "%undefined method `email' for nil:NilClass\n/app/app/mailers/assessment_criterion_mailer.rb:12:in `notify_participant'%").order(updated_at: :desc).each do |job| | |
p YAML.load(job.handler).args.first | |
end |
This file contains hidden or 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
$ wget $(heroku pg:backups public-url -a legacy-next-staging) -O tmp/tti_legacy.dump | |
Remove all conections to database (for example shut down rails servers or rails console). | |
# From legacy project: | |
$ bundle exec rake db:drop db:create | |
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U ivanbisevac1 -d tti_development tmp/tti_legacy.dump | |
$ bundle exec rake db:migrate | |
# On roundabout project: |
This file contains hidden or 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
http://blog.blenderbox.com/2013/02/20/ssh-agent-forwarding-with-github/ |
This file contains hidden or 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
https://help.ubuntu.com/community/PostgreSQL | |
sudo -u postgres psql |
This file contains hidden or 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
$ heroku pg:backups -a tti-cedar | |
$ curl -o tmp/legacy-a665.dump "urlfrompreviouscommand" | |
Remove all conections to database (for example shut down rails servers or rails console). | |
# From legacy project: | |
$ bundle exec rake db:drop | |
$ bundle exec rake db:create | |
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U ivanbisevac1 -d tti_development tmp/legacy-a665.dump | |
$ bundle exec rake db:migrate |
This file contains hidden or 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
http://winstonyw.com/2014/03/03/time_now_vs_time_zone_now/ |
This file contains hidden or 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 CompressedRequests | |
def initialize(app) | |
@app = app | |
end | |
def method_handled?(env) | |
!!(env['REQUEST_METHOD'] =~ /(POST|PUT)/) | |
end | |
def encoding_handled?(env) |
This file contains hidden or 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
http://blog.mattwynne.net/2012/04/09/hexagonal-rails-introduction/ | |
http://darwinweb.net/articles/modular-development-on-rails |
This file contains hidden or 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
require 'open-uri' | |
require 'nokogiri' | |
doc = Nokogiri::XML(open("http://www.blic.rs/rss/danasnje-vesti")) | |
items = doc.xpath("//item") | |
puts "Укупан број данашњих вести: #{items.count}" | |
items.each do |item| |