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
{ | |
"fields": [ | |
{ | |
"expression": { | |
"attribute_name": "confirmation_number", | |
"object_type": "attendee" | |
}, | |
"header": "Confirmation #" | |
}, | |
{ |
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
#!/bin/sh | |
git filter-branch -f \ | |
--index-filter 'git rm --cached --ignore-unmatch Rakefile' HEAD | |
git filter-branch --env-filter ' | |
OLD_EMAIL="[email protected]" | |
CORRECT_NAME="John Anderson" | |
CORRECT_EMAIL="[email protected]" |
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 execjs | |
import os | |
here = os.path.dirname(__file__) | |
node_modules = os.path.abspath(os.path.join(here, './node_modules')) | |
class Babel: | |
def __init__(self, *module_paths): | |
"""Constructor | |
:param module_paths: Paths to node_modules |
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
from datetime import datetime | |
now = datetime.utcnow() | |
t = now.timestamp() | |
t2 = datetime.utcfromtimestamp(t) | |
assert now == t2, 'Why no work?' |
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 time | |
import uuid | |
import yappi | |
import timeit | |
import logging | |
import random | |
from threading import Event | |
from cassandra import ConsistencyLevel | |
from cassandra.cluster import Cluster |
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
Tracing session: 43c34fb0-f054-11e4-8ca4-b9a936855b1e | |
activity | timestamp | source | source_elapsed | |
---------------------------------------------------------------------------------------------------------+----------------------------+---------------+---------------- | |
Execute CQL3 query | 2015-05-01 15:49:03.275000 | 10.128.36.179 | 0 | |
Parsing select * from hour_response where survey_id=100326883 and hour_created=1; [SharedPool-Worker-1] | 2015-05-01 15:49:03.277000 | 10.128.36.179 | 110 | |
Preparing statement [SharedPool-Worker-1] | 2015-05-01 15:49:03.277000 | 10.128.36.179 | 275 | |
Sending message to /10.128.36.193 [WRITE-/10.128.36.193] | 2015-05-01 15:49:03.278000 |
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 time | |
import uuid | |
from functools import partial | |
from cassandra.cluster import Cluster | |
from multiprocessing import Pool, Queue, Process, Manager | |
from threading import Event | |
from cassandra.query import dict_factory, tuple_factory | |
from cassandra.cluster import PagedResult | |
from cassandra.io.libevreactor import LibevConnection |
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
DESCRIBE schema | |
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true; | |
CREATE TABLE test.response ( | |
survey_id int, | |
hour_created int, | |
respondent_id int, | |
date_created text, | |
date_deleted text, |
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 time | |
import uuid | |
from cassandra.cluster import Cluster | |
from multiprocessing import Pool, Queue, Process, Manager | |
from threading import Event | |
from cassandra.cluster import Cluster | |
from cassandra.query import dict_factory | |
from cassandra.cluster import PagedResult | |
start_time = time.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 time | |
import uuid | |
from threading import Event | |
from cassandra.cluster import Cluster | |
from cassandra.query import dict_factory | |
start_time = time.time() | |
c = Cluster(['127.0.0.1']) | |
s = c.connect('test') | |
s.row_factory = dict_factory |