grep -nr search_string search_dir
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
def regex(str) = str =~ /^https?:\/\//i | |
def starts_with(str) | |
str.start_with?("http://") || str.start_with?("https://") | |
end | |
strings = [ | |
"https://example.com", | |
"http://example.com", | |
"example1", |
xinput # to list devices
alias trackpadoff="xinput disable \"AlpsPS/2 ALPS DualPoint Stick\""
alias trackpadon="xinput enable \"AlpsPS/2 ALPS DualPoint Stick\""
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
$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) |
bundle show nokogiri
/home/edouard/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.8-x86_64-linux
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
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__); |
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`
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'
NewerOlder