Skip to content

Instantly share code, notes, and snippets.

View gist:e3b7acb4cc10a0b3c8aea5a460d88804
{
"object_types": "attendee",
"sort_by": [
{
"descending": false,
"expression": {
"element_id": "ATTENDEE_NAME",
"attribute_name": "last_name",
"object_type": "response"
}
View Example Report Payload.json
{
"object_types": "attendee",
"sort_by": [
{
"descending": false,
"expression": {
"element_id": "ATTENDEE_NAME",
"attribute_name": "last_name",
"object_type": "response"
}
View gist:14a9d834df21b7aa6ffe656325c47c7b
{
"fields": [
{
"expression": {
"attribute_name": "confirmation_number",
"object_type": "attendee"
},
"header": "Confirmation #"
},
{
View gist:76cd78da3808f188fc9550f8bdd84ba7
{
"fields": [
{
"expression": {
"attribute_name": "confirmation_number",
"object_type": "attendee"
},
"header": "Confirmation #"
},
{
@sontek
sontek / rename.sh
Created Jul 8, 2018
Rename author in git
View rename.sh
#!/bin/sh
git filter-branch -f \
--index-filter 'git rm --cached --ignore-unmatch Rakefile' HEAD
git filter-branch --env-filter '
OLD_EMAIL="housewifehacker@gmail.com"
CORRECT_NAME="John Anderson"
CORRECT_EMAIL="sontek@gmail.com"
@sontek
sontek / babylon.py
Created Nov 29, 2015
Render react.js from Python
View babylon.py
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
@sontek
sontek / python_dates.py
Created Sep 22, 2015
Python 3 can't handle dates.
View python_dates.py
from datetime import datetime
now = datetime.utcnow()
t = now.timestamp()
t2 = datetime.utcfromtimestamp(t)
assert now == t2, 'Why no work?'
@sontek
sontek / gist:af82d281e618074ca8a6
Last active Jun 30, 2020
Cassandra benchmark
View gist:af82d281e618074ca8a6
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
View gist:060b8a801e9545053bce
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
@sontek
sontek / gist:0f65e71401fadd1293ea
Created May 1, 2015
multiprocessing cassandra v2
View gist:0f65e71401fadd1293ea
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
You can’t perform that action at this time.