Skip to content

Instantly share code, notes, and snippets.

View jthandy's full-sized avatar

Tristan Handy jthandy

View GitHub Profile
with invoices as (
select *
from {{env.schema}}.stripe_invoices_cleaned
where paid is true
and forgiven is false
),
select
customer,
timestamp 'epoch' + date * interval '1 Second' as date,
forgiven,
subscription_id,
paid,
total,
timestamp 'epoch' + period_start * interval '1 Second' as period_start,
timestamp 'epoch' + period_end * interval '1 Second' as period_end
Verifying that +jthandy is my blockchain ID. https://onename.com/jthandy
@jthandy
jthandy / data_scientists.sql
Created October 7, 2015 15:56
The query we used in the RJMetrics benchmark report "The State of Data Science" to identify data scientist profiles.
/*
Look for Data Scientists in the following 9 languages:
-- English
-- Spanish
-- French
-- German
-- Dutch
-- Swedish
-- Italian
@jthandy
jthandy / data_import_api_call.rb
Last active December 16, 2015 03:49
A simple code snippet to post data to the RJMetrics Data Import API.
def push_to_warehouse(table, data_to_push)
response = HTTParty.post("https://connect.rjmetrics.com/v1/client/#{cid}/table/#{table}/data?apikey=#{apikey}",
body: data_to_push.to_json,
headers: { 'Content-Type' => 'application/json' })
response
end