GC.stat[:heap_live_slots]
- <1 million = don't sweat it
- 1mil->3mil = Pretty average
- 3mil->5mil = Typical of Big Chonker Monoliths
- 5mil->10mil = Something probably wrong, fix to reduce RSS usage + speed up your GCs
<?php | |
namespace MetarDecoder\Service; | |
use MetarDecoder\Exception\DatasetLoadingException; | |
class DatasetProvider | |
{ | |
private $base_dir; |
# config/initializers/i18n.rb | |
require 'i18n' | |
# Configure it as you want | |
I18n.load_path = Dir["config/locales/**.yml"] | |
I18n.enforce_available_locales = true | |
I18n.default_locale = "en" | |
I18n.backend.load_translations |
SELECT tc.table_schema, tc.constraint_name, tc.table_name, kcu.column_name, ccu.table_name
AS foreign_table_name, ccu.column_name AS foreign_column_name
FROM information_schema.table_constraints tc
JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name
JOIN information_schema.constraint_column_usage ccu ON ccu.constraint_name = tc.constraint_name
WHERE constraint_type = 'FOREIGN KEY'
AND ccu.table_name='name_of_your_target_table_here'
SELECT | |
pid, | |
now() - pg_stat_activity.query_start AS duration, | |
query, | |
state | |
FROM pg_stat_activity | |
WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes'; | |
SELECT pg_cancel_backend(__pid__); |
$ bundle show nokogiri | |
/home/edouard/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.8-x86_64-linux |
Pick a date, pick a branch, here you go
git checkout `git rev-list -n 1 --first-parent --before="2019-07-27 13:37" master`
$requires_index = {} | |
if true | |
# Override the require method to track load times | |
def custom_require(file) | |
starting = Process.clock_gettime(Process::CLOCK_MONOTONIC) | |
result = original_require(file) | |
ending = Process.clock_gettime(Process::CLOCK_MONOTONIC) |
xinput # to list devices | |
alias trackpadoff="xinput disable \"AlpsPS/2 ALPS DualPoint Stick\"" | |
alias trackpadon="xinput enable \"AlpsPS/2 ALPS DualPoint Stick\"" |