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
Futura PT | |
Graphik | |
Inter UI |
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
Rails.application.configure do | |
# Settings specified here will take precedence over those in config/application.rb. | |
# In the development environment your application's code is reloaded on | |
# every request. This slows down response time but is perfect for development | |
# since you don't have to restart the web server when you make code changes. | |
config.cache_classes = !!ENV["PROFILE"] | |
# Do not eager load code on boot. | |
config.eager_load = !!ENV["PROFILE"] |
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
# Signal catching | |
def shut_down | |
puts "\nShutting down gracefully..." | |
sleep 1 | |
end | |
puts "I have PID #{Process.pid}" | |
# Trap ^C | |
Signal.trap("INT") { |
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
2020-11-19T12:34:41.054839+00:00 app[web.1]: F, [2020-11-19T12:34:41.054744 #34] FATAL -- : [3a52ba07-f9a1-4a7e-bed6-25affba1b729] Rack::Timeout::RequestTimeoutException (Request waited 5ms, then ran for longer than 30000ms ): | |
2020-11-19T12:34:41.054840+00:00 app[web.1]: F, [2020-11-19T12:34:41.054787 #34] FATAL -- : [3a52ba07-f9a1-4a7e-bed6-25affba1b729] | |
2020-11-19T12:34:41.054961+00:00 app[web.1]: F, [2020-11-19T12:34:41.054886 #34] FATAL -- : [3a52ba07-f9a1-4a7e-bed6-25affba1b729] vendor/bundle/ruby/2.6.0/gems/excon-0.78.0/lib/excon/socket.rb:279:in `select' | |
2020-11-19T12:34:41.054962+00:00 app[web.1]: [3a52ba07-f9a1-4a7e-bed6-25affba1b729] vendor/bundle/ruby/2.6.0/gems/excon-0.78.0/lib/excon/socket.rb:279:in `select_with_timeout' | |
2020-11-19T12:34:41.054962+00:00 app[web.1]: [3a52ba07-f9a1-4a7e-bed6-25affba1b729] vendor/bundle/ruby/2.6.0/gems/excon-0.78.0/lib/excon/socket.rb:140:in `rescue in block in connect' | |
2020-11-19T12:34:41.054963+00:00 app[web.1]: [3a52ba07-f9a1-4a7e-bed6-25affba1b729] vendor/bundle |
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
commit b5680a7effab8bb9f1b1542366b6dad36fe23611 | |
Author: Pau Perez <saulopefa@gmail.com> | |
Date: Thu Jan 7 11:21:00 2021 +0100 | |
Turn to 2 queries into one with another INNER JOIN | |
There's no need to fetch the votes' authors first if we can scope the | |
query to the votes' records we care about in a single statement. | |
Letting the DB do its job results in less code on our side and better | |
performance. We skip Ruby CPU cycles and a network round trip for each |
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
commit 74fb66e93619074dda3bd98cfe935c4ced30143f | |
Author: Pau Perez <saulopefa@gmail.com> | |
Date: Thu Jan 7 12:29:40 2021 +0100 | |
Count occurrences of foreign key instead of join | |
As we just care for the count of users and not about any of their | |
details there's no need to join with the users table. The foreign key | |
column is enough to count. |
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
-- questions + count of its delegated votes | |
SELECT | |
questions_with_delegation_votes_count.*, | |
CASE | |
WHEN has_granter THEN count_by_setting_id | |
ELSE 0 | |
END AS total_delegates | |
FROM ( | |
SELECT | |
decidim_consultations_questions.*, |
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
[m for m in dir(object) if not m.startswith('_')] |
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
# Then, open it in your default $BROWSER | |
$ python -m webbrowser -t tacto-fastapi-v2/tests/rendered.html |
OlderNewer