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 kazoo | |
from kazoo.client import KazooClient | |
REDIS_NODE_PATH="/backend/caches/redis" | |
zk = KazooClient(hosts='127.0.0.1:2181') | |
zk.start() | |
node_ids = {"000": "127.0.0.1:6379", | |
"001": "127.0.0.1:6380", |
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 math | |
import sys | |
import time | |
import requests | |
from urllib.request import urlopen | |
from multiprocessing import Process, Queue | |
success_count = 0 |
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 requests | |
import json | |
class SimpleSlackClient(object): | |
def __init__(self, token): | |
self.token = token | |
def api_call(self, api_end_point, channel, text, | |
domain="slack.com", user=None, timeout=None, proxies=None, **kwargs): | |
url = 'https://{domain}/api/{api_end_point}'.format(domain=domain, |
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 java.io.*; | |
import java.util.*; | |
import java.util.stream.*; | |
class Test { | |
static int[] joinArray(int[]... arrays) { | |
int length = 0; | |
for (int[] array : arrays) { | |
length += array.length; | |
} |
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 sys | |
def convert_misspel_to_sed(line): | |
parts = line.split(':') | |
filename = parts[0] | |
line_no = parts[1] | |
keyparts = parts[2].split("->") | |
misspel = keyparts[0].strip() | |
valids = [keyword[1:-1] for keyword in keyparts[1].strip().split(',')] |
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 time | |
from slackclient import SlackClient | |
from github import Github | |
GITHUB_ID = os.environ.get('GITHUB_ID') | |
GITHUB_PASS = os.environ.get('GITHUB_PASS') | |
github = Github(GITHUB_ID, GITHUB_PASS) | |
BOT_ID = os.environ.get("BOT_ID") |
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 sys | |
def custom_except_hook(exctype, value, traceback): | |
print("global excaption handleing") | |
print(exctype) | |
print(value) | |
print(traceback) | |
sys.__excepthook__(exctype, value, traceback) | |
sys.excepthook = custom_except_hook |
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 pymysql | |
import mmh3 | |
conns={} | |
hosts=["127.0.0.1", "127.0.0.1"] | |
user= | |
passwd= | |
dbname="test" | |
MAX_LOGICAL_ID=8192 | |
MAX_PHYSICAL_ID=len(hosts) |
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 numpy | |
import cv2 | |
import sys | |
image = cv2.imread(sys.argv[1], 0) | |
height = len(image) | |
width = len(image[0]) | |
#window size(3x3) | |
hy = 3 |
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 click | |
import boto3 | |
#aws access key should be in ~/.aws/credentials | |
@click.group() | |
def cli(): | |
pass | |
@cli.command() | |
@click.option('--count', default=1, help='Number of creating') |