Skip to content

Instantly share code, notes, and snippets.

View tbaylis's full-sized avatar
👨‍💻

Tom Baylis tbaylis

👨‍💻
View GitHub Profile
@chrismdp
chrismdp / s3.sh
Last active July 23, 2024 16:47
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
with days as (
select '2019-12-31'::date as date_day union all
select '2020-01-01'::date as date_day union all
select '2020-01-02'::date as date_day union all
select '2020-01-03'::date as date_day union all
select '2020-01-04'::date as date_day union all
select '2020-01-05'::date as date_day
),
events as (
select 1 as user_id, 'drew' as name, '2020-01-01'::date as event_time union all