Skip to content

Instantly share code, notes, and snippets.

Gandalf: Take the ring to Mount Doom, you must, Frodo. [The audience is confused by Gandalf's sudden change in speech patterns.]
Frodo: But Gandalf, I don't know if I can do it. It's such a dangerous mission. [The audience is unsure what to make of this strange conversation.]
Gandalf: Dangerous, it is. But necessary, it is also. The fate of Middle-earth depends on it, Frodo. [The audience is starting to catch on to the fact that Gandalf is speaking like Yoda.]
Frodo: But why me, Gandalf? Why not someone else? Someone more capable? [The audience is still trying to understand what's happening.]
Gandalf: Chosen, you are, Frodo. The ring chose you, and you must accept your destiny. [The audience is starting to realize that this is some sort of crossover between the worlds of Middle-earth and the Star Wars universe.]
Gandalf: Take the ring to Mount Doom, you must, Frodo. [The audience is confused by Gandalf's sudden change in speech patterns.]
Frodo: But Gandalf, I don't know if I can do it. It's such a dangerous mission. [The audience is unsure what to make of this strange conversation.]
Gandalf: Dangerous, it is. But necessary, it is also. The fate of Middle-earth depends on it, Frodo. [The audience is starting to catch on to the fact that Gandalf is speaking like Yoda.]
Frodo: But why me, Gandalf? Why not someone else? Someone more capable? [The audience is still trying to understand what's happening.]
Gandalf: Chosen, you are, Frodo. The ring chose you, and you must accept your destiny. [The audience is starting to realize that this is some sort of crossover between the worlds of Middle-earth and the Star Wars universe.]
import random
import pyorc
# use rows of random numbers and strings as test data
fields = ",".join([f"a{y}:string,b{y}:float" for y in range(25)])
spec = f"struct<{fields}>"
def gen_row():
$ rclone --config /tmp/rclone.conf sync -vv --include \*.csv --transfers 1 --retries 10 gcs:XXX/path gcs:YYY/incoming
2019/11/12 19:08:39 DEBUG : rclone: Version "v1.50.1" starting with parameters ["rclone" "--config" "/tmp/rclone.conf" "sync" "-vv" "--include" "*.csv" "--transfers" "1" "--retries" "10" "gcs:XXX/path" "gcs:YYY/path"]
2019/11/12 19:08:39 DEBUG : Using config file from "/tmp/rclone.conf"
2019/11/12 19:08:40 DEBUG : : Excluded
2019/11/12 19:08:40 INFO : GCS bucket XXX path incoming: Waiting for checks to finish
2019/11/12 19:08:40 INFO : GCS bucket XXX path incoming: Waiting for transfers to finish
2019/11/12 19:08:48 ERROR : file.csv: Failed to copy: googleapi: Error 413: Copy spanning locations and/or storage classes could not complete within 30 seconds. Please use the Rewrite method (https://cloud.google.com/storage/docs/json_api/v1/objects/rewrite) instead., uploadTooLarge
2019/11/12 19:08:48 ERROR : GCS bucket XXX path incoming: not deleting files as there were IO errors
2019/11/12 19:08:
[{
"url": "www.liveleak.com",
"media": {},
"actions": {
"load": 379201,
"progress": null,
"play": null,
"hover": 117909,
"view": null
},
// colorwheel demo for RGBmatrixPanel library.
// Renders a nice circle of hues on a 32x32 RGB LED matrix.
#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library
// If your 32x32 matrix has the SINGLE HEADER input,
// use this pinout:
#define CLK 8 // MUST be on PORTB!
#define OE 9
// colorwheel demo for RGBmatrixPanel library.
// Renders a nice circle of hues on a 32x32 RGB LED matrix.
#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library
// If your 32x32 matrix has the SINGLE HEADER input,
// use this pinout:
#define CLK 8 // MUST be on PORTB!
#define OE 9
cqlsh> ALTER KEYSPACE "Analytics" WITH strategy_class = NetworkTopologyStrategy;
Invalid syntax at line 1, char 16
ALTER KEYSPACE "Analytics" WITH strategy_class = NetworkTopologyStrategy;
^
@JohnEmhoff
JohnEmhoff / gist:5591773
Created May 16, 2013 13:35
Full Contact example call
{
"status": 200,
"likelihood": 0.89,
"requestId": "87a2942c-73db-4c04-bb0a-d243d824c2c8",
"photos": [{
"typeName": "Twitter",
"type": "twitter",
"typeId": "twitter",
"url": "https://d2ojpxxtu63wzl.cloudfront.net/static/c9084e23b4f398c7b95d384e220d94e3_80648ca870dd5e8371f1f1ad3eea30e26588792d325f50a98598ece0c04d4478",
"isPrimary": true
@JohnEmhoff
JohnEmhoff / demo.py
Last active December 15, 2015 16:09
Quick demo of some new NLP features in the Embedly API
import sys
import json
import urllib
import requests
def reddit(sub):
"""
Retrieve the json representation of the given subreddit