Skip to content

Instantly share code, notes, and snippets.

<h4>Enter your email</h4>
<input />
<div style='color:red'></div>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
-- Generate a series of months! (join with other time series to get 0 values):
-- { ----
SELECT * FROM generate_series('2010-01-01'::date, '2011-01-01', '1 months')
select distinct date_trunc('month', (current_date - offs)) as date
from generate_series(0,365,28) as offs
order by 1 desc
select distinct date_trunc('day', (current_date - offs)) as date
SELECT
*
FROM
reports_account_snapshot
WHERE
event_date IN (
SELECT MAX(event_date)
FROM reports_account_snapshot
GROUP BY date_trunc('month',event_date), date_trunc('year',event_date)
git commit --allow-empty -m "empty commit"
git push -f heroku master
@nathan-castor
nathan-castor / 0_reuse_code.js
Created November 16, 2016 04:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console