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
WITH longrunners AS ( | |
SELECT pid, age(query_start, clock_timestamp()), query_start, usename, query | |
FROM pg_stat_activity | |
WHERE | |
now() - query_start > '3 minutes'::interval | |
AND | |
query NOT ILIKE '%vacuum%' | |
ORDER BY query_start desc | |
) | |
SELECT pg_cancel_backend(pid) |
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
# <3 leon | |
const Objects = [{}, {}, {}]; | |
const PromiseBuilders = Objects.map(o => () => promise(o)) | |
const serial = ([first, ..rest], results = []) => | |
first === undefined | |
? Promise.resolve(results) | |
: first() |
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
Pyth-seudocode time! | |
erasto(n): // circa 240 BC haha | |
a[1] := 0 | |
for i := 2 to n do a[i] := 1 | |
p := 2 | |
while p^2 < n do |