Skip to content

Instantly share code, notes, and snippets.

@slattery
slattery / pg_nextdowinstance.sql
Created July 2, 2012 02:20
Find the next occurence of a day of the week in postgresql
-- I'd gladly pay you Tuesday for a hamburger today!
-- OK, see you next Tuesday.
SELECT *
FROM generate_series
(
current_date + '1 day'::interval, -- in case now() is same dow
current_date + '7 days'::interval,
'1 day'
) as s(a)
@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container