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 os | |
import hashlib | |
import sys | |
from pathlib import Path # python < 3.4 : pip install pathlib | |
def md5(path): | |
content = path.open('br').read() | |
return hashlib.md5(content).hexdigest() |
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 json | |
import requests | |
API_KEY = '' | |
PROJECT_ID = '' | |
COLLECTION_NAME = '' | |
filters = [{'property_name': 'keen.timestamp', 'operator': 'eq', 'property_value': '2015-02-02T10:20:00.000'}] | |
resp = requests.delete('https://api.keen.io/3.0/projects/' + PROJECT_ID + '/events/' + COLLECTION_NAME +'?api_key=' + API_KEY + '&filters=' + json.dumps(filters)) |
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 os | |
from behaving import environment as benv | |
from splinter import Browser | |
default_browser = Browser() | |
PERSONAS = {} | |
def _mkdir(path): | |
return os.makedirs(path) if not os.path.exists(path) else None |
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
# Search usernames that begins with given phrase | |
# | |
# usernames: (username1, username2, ..) | |
# userscore:<username>: float | |
# user:obj: { id: int, username: string } | |
usernames_zset = "usernames" | |
def my_ord(c): | |
return "%03d" % ord(c) |
NewerOlder