Skip to content

Instantly share code, notes, and snippets.

@reallabs
reallabs / .sql
Created April 17, 2018 21:46
Goal Charts in SQL
WITH dates as (
SELECT ds, row_number() OVER () as rnum
FROM generate_series(
date_trunc('month', now())::timestamp AT TIME ZONE 'PST',
date_trunc('month', now() + INTERVAL '1 month')::timestamp AT TIME ZONE 'PST',
'24 hours')
as ds
)
SELECT ds, goal,
@reallabs
reallabs / test.js
Created October 18, 2019 00:35
Adjust Cost API not working
const fetch = require("node-fetch");
let clickId = 111450850;
winston.info("Trying to send cost data to adjust for click_id: " + clickId);
let data = {
cost_type: "cpi",
cost_currency: "usd",
cost_amount: "1.72",
cost_id: "jetfuel_" + clickId,
tag: "jetfuel"