This file contains hidden or 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 io | |
import click | |
import yaml | |
import zipfile | |
@click.command() | |
@click.option('--file') | |
@click.option('--size', default=2) | |
def main(file, size): |
This file contains hidden or 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
create external schema spectrum_polku_dev from data catalog | |
database 'lake-spectrum' | |
iam_role 'arn:aws:iam::531820706523:role/lake-redshift-DEV-RedshiftIamRole-1WJEOPK9KU5MF' | |
create external database if not exists; | |
drop table spectrum_polku_dev.offer_found_parquet; | |
create external table spectrum_polku_dev.offer_found_parquet ( | |
anonymous_id varchar, | |
context_app_name varchar, | |
context_ip bigint, |
This file contains hidden or 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 time | |
from collections import deque | |
import greenlet | |
tasks = deque([greenlet.getcurrent()]) | |
def spawn(fn): | |
g = greenlet.greenlet(fn) | |
g.switch() |
This file contains hidden or 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 zerorpc | |
import random | |
import gevent | |
from random import randrange | |
import time | |
def my_task_rbs2(): | |
try: | |
client = zerorpc.Client(timeout=30, heartbeat=5) | |
client.connect('tcp://localhost:4243') |
This file contains hidden or 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
from datetime import datetime | |
import pandas as pd | |
import numpy as np | |
result = np.empty(10, dtype=[('name', 'object'), | |
('value', 'int64'), | |
('date', 'datetime64[us]')]) | |
result[0] = ('a', 1, datetime.now()) | |
result[1] = ('b', 1, datetime.now()) |
This file contains hidden or 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 time | |
import logging | |
logging.basicConfig(level=logging.DEBUG) | |
from cassandra.cluster import Cluster | |
from cassandra.policies import DCAwareRoundRobinPolicy | |
cluster = Cluster(['a.remote.net', 'b.remote.net'], | |
load_balancing_policy=DCAwareRoundRobinPolicy('DC1')) |
This file contains hidden or 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: supervisord | |
# Required-Start: $remote_fs | |
# Required-Stop: $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
This file contains hidden or 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
cmake -G "Unix Makefiles" -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.6.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 -DJPEG_INCLUDE_DIR=/usr/local/opt/jpeg-turbo/include -DJPEG_LIBRARY=/usr/local/opt/jpeg-turbo/lib/libturbojpeg.a -DGETTEXT_INCLUDE_DIR=/usr/local/opt/gettext/include -DLIBINTL_LIBRARY=/usr/local/opt/gettext/lib/libintl.a ../ |
This file contains hidden or 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
ERROR:root:Exception in I/O handler for fd 20 | |
Traceback (most recent call last): | |
File "/home/vagrant/env/lib/python2.6/site-packages/zmq/eventloop/ioloop.py", line 340, in start | |
self._handlers[fd](fd, events) | |
KeyError: 20 | |
ERROR:root:Exception in I/O handler for fd 23 | |
Traceback (most recent call last): | |
File "/home/vagrant/env/lib/python2.6/site-packages/zmq/eventloop/ioloop.py", line 340, in start | |
self._handlers[fd](fd, events) |
This file contains hidden or 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 time | |
import logging | |
logging.basicConfig(level=logging.DEBUG) | |
from circus import get_arbiter | |
class Test(object): | |
def __init__(self): | |
self.arbiter = get_arbiter([], debug=True, |
NewerOlder