View example.py
import requests
class Redash(object):
def __init__(self, redash_url, api_key):
self.redash_url = redash_url
if not self.redash_url.endswith('/'):
self.redash_url = '{}/'.format(self.redash_url)
self.auth_headers = {'Authorization': 'Key {}'.format(api_key)}
View dynamodb_readonly.json
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"dynamodb:BatchGetItem",
"dynamodb:DescribeTable",
"dynamodb:GetItem",
"dynamodb:ListTables",
"dynamodb:Query",
View refresh.py
import os
import requests
import time
from pprint import pprint
def poll_job(s, redash_url, job):
# TODO: add timeout
while job['status'] not in (3,4):
response = s.get('{}/api/jobs/{}'.format(redash_url, job['id']))
View countries.json
{"rows": [{"code": "BD", "continent": "AS", "name": "Bangladesh"}, {"code": "BE", "continent": "EU", "name": "Belgium"}, {"code": "BF", "continent": "AF", "name": "Burkina Faso"}, {"code": "BG", "continent": "EU", "name": "Bulgaria"}, {"code": "BA", "continent": "EU", "name": "Bosnia and Herzegovina"}, {"code": "BB", "continent": "NA", "name": "Barbados"}, {"code": "WF", "continent": "OC", "name": "Wallis and Futuna"}, {"code": "BL", "continent": "NA", "name": "Saint Barthelemy"}, {"code": "BM", "continent": "NA", "name": "Bermuda"}, {"code": "BN", "continent": "AS", "name": "Brunei"}, {"code": "BO", "continent": "SA", "name": "Bolivia"}, {"code": "BH", "continent": "AS", "name": "Bahrain"}, {"code": "BI", "continent": "AF", "name": "Burundi"}, {"code": "BJ", "continent": "AF", "name": "Benin"}, {"code": "BT", "continent": "AS", "name": "Bhutan"}, {"code": "JM", "continent": "NA", "name": "Jamaica"}, {"code": "BV", "continent": "AN", "name": "Bouvet Island"}, {"code": "BW", "continent": "AF", "name": "Botswan
View cohort.sql
with
time_frame as (
select current_date - 14
),
population as (
select created_at::date as cohort_date, id as unique_id
from organizations
where created_at > (select * from time_frame)
View keybase.md

Keybase proof

I hereby claim:

  • I am arikfr on github.
  • I am arikfr (https://keybase.io/arikfr) on keybase.
  • I have a public key ASBNUSKY0adYMAYhkO4QmrqOdjIuV4DtSAtiPsuyb6ZjIgo

To claim this, I am signing this object:

View dashboard_editor.py
import os
import sys
import requests
import json
import time
REDASH_HOST = os.environ.get('REDASH_HOST', 'https://app.redash.io/account')
API_KEY = '...'
View poll.py
import os
import requests
import time
from pprint import pprint
REDASH_HOST = os.environ.get('REDASH_HOST', 'https://demo.redash.io')
def poll_job(s, job):
# TODO: add timeout
while job['status'] not in (3,4):
View refresh_example.py
REDASH_HOST = os.environ.get('REDASH_HOST', 'https://app.redash.io/name')
def poll_job(s, job):
# TODO: timeout
while job['status'] not in (3,4):
response = s.get('{}/api/jobs/{}'.format(REDASH_HOST, job['id']))
job = response.json()['job']
time.sleep(1)
return job['status'] == 3
View promises_caching.js
var inProgressUrls = {};
function grabScreenshot(url) {
var inProgress = inProgressUrls[url];
if (inProgress) {
return inProgress;
}
var promise = new Promise(function(fulfill, reject) {
... grab screenshot ...