This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* AES Encryption with PKCS7 padding http://en.wikipedia.org/wiki/Padding_(cryptography)#PKCS7 | |
* https://gist.github.com/RiANOl/1077723 | |
* http://php.net/manual/en/function.mcrypt-encrypt.php | |
* http://stackoverflow.com/questions/7448763/proper-php-mcrypt-encryption-methods | |
* | |
* User: martinhalamicek | |
* Date: 7/8/13 | |
* Time: 3:06 PM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
import requests | |
class HttpHelper: | |
server = "https://connection.keboola.com/v2/" | |
def __init__(self,token): | |
self.token = token | |
def tokenheader(self): | |
return {'X-StorageApi-Token':self.token} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""This module is intended to help interactions | |
with Goodata Keboola storage. | |
It creates and performs requests and parse response back | |
to handler which called it. | |
""" | |
import json | |
import logging as log | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select t1.query_type, | |
t1.avg_time as current_avg, | |
t2.avg_time as previous_avg, | |
t1.avg_time / t2.avg_time as performance_ratio | |
from | |
(select query_type, count(*) as query_count, avg(total_elapsed_time) as avg_time | |
from table(information_schema.query_history_by_user( | |
'ct_us_keboola_3292', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"S3FilesBucket": { | |
"Type": "AWS::S3::Bucket", | |
"Properties": { | |
"CorsConfiguration": { | |
"CorsRules": [ | |
{ | |
"AllowedHeaders": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parameters": { | |
"api": { | |
"baseUrl": "https://slack.com/api/" | |
}, | |
"config": { | |
"outputBucket": "slack", | |
"debug": true, | |
"jobs": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parameters": { | |
"api": { | |
"baseUrl": "https:\/\/api.intercom.io", | |
"authentication": { | |
"type": "basic" | |
}, | |
"http": { | |
"defaultOptions": { | |
"headers": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"authorization": { | |
"oauth_api": { | |
"id": "new-template-60" | |
} | |
}, | |
"parameters": { | |
"api": { | |
"authentication": { | |
"type": "oauth10" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parameters": { | |
"api": { | |
"baseUrl": "http://api.fixer.io/" | |
}, | |
"config": { | |
"outputBucket": "currency", | |
"incrementalOutput": true, | |
"jobs": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download latest version of Storage API Command line client | |
wget https://s3.amazonaws.com/keboola-storage-api-cli/builds/sapi-client.phar | |
# import table into Storage API asynchronously | |
php sapi-client.phar write-table --token=your_token in.c-main.users ./data.csv.gz |
NewerOlder