Skip to content

Instantly share code, notes, and snippets.

View jornh's full-sized avatar
Connecting dots between people & data


Connecting dots between people & data
View GitHub Profile
jornh /
Created January 24, 2018 07:12 — forked from uhho/
Streaming pandas DataFrame to/from S3 with on-the-fly processing and GZIP compression
def s3_to_pandas(client, bucket, key, header=None):
# get key using boto3 client
obj = client.get_object(Bucket=bucket, Key=key)
gz = gzip.GzipFile(fileobj=obj['Body'])
# load stream directly to DF
return pd.read_csv(gz, header=header, dtype=str)
def s3_to_pandas_with_processing(client, bucket, key, header=None):
#include <stdio.h>
#include <sodium.h>
#define MESSAGE ((const unsigned char *) "test")
#define MESSAGE_LEN 4
#define CIPHERTEXT_LEN (crypto_secretbox_MACBYTES + MESSAGE_LEN)
void receiving_end(unsigned char *ciphertext, unsigned char *nonce, unsigned char *key) {
unsigned char decrypted[MESSAGE_LEN];
jornh /
Created November 1, 2016 13:46 — forked from willurd/
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
jornh / designer.html
Last active August 29, 2015 14:07
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
:host {
position: absolute;