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
package javaapplication1; | |
import java.io.*; | |
import java.net.*; | |
import org.apache.http.Header; | |
import org.apache.http.client.methods.CloseableHttpResponse; | |
import org.apache.http.client.methods.HttpPost; | |
import org.apache.http.entity.ContentType; |
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
{ | |
"run_list": [ "recipe[java]", | |
"recipe[monit]", | |
"recipe[elasticsearch]", | |
"recipe[elasticsearch::plugins]", | |
"recipe[elasticsearch::monit]" ], | |
"java": { | |
"install_flavor": "openjdk", | |
"jdk_version": "7" |
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 |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
{ | |
"title": "SAPI", | |
"services": { | |
"query": { | |
"idQueue": [ | |
1, | |
2, | |
3, | |
4 | |
], |
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 | |
/** | |
* Storage API table write example | |
*/ | |
$client = new \Keboola\StorageApi\Client('your_token'); | |
$csvFile = new Keboola\Csv\CsvFile(__DIR__ . '/my-file.csv.gz', ',', '"'); | |
$client->writeTableAsync('in.c-main.my-table', $csvFile); |
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
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
<?php | |
/** | |
* AES Encryption in CBC mode with PKCS7 padding | |
* | |
* User: martinhalamicek | |
* Date: 7/8/13 | |
* Time: 3:06 PM | |
*/ | |
namespace Keboola\Encryption; |
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 in CBC mode with PKCS7 padding | |
* | |
* User: martinhalamicek | |
* Date: 7/8/13 | |
* Time: 3:06 PM | |
*/ | |
namespace Keboola\Encryption; |