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
package activity; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.provider.Browser; | |
import android.support.v7.app.AppCompatActivity; | |
import BuildConfig; | |
import R; |
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
# python3 bots.py localhost 8080 100 4 1 | |
import random | |
import select | |
import socket | |
import sys | |
import time | |
from datetime import datetime | |
eventmask = select.POLLIN | select.POLLPRI | select.POLLHUP | select.POLLERR |
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 csv | |
from easydict import EasyDict | |
default_reader = csv.DictReader | |
def load_tsv(path, reader=default_reader): | |
return load_csv(path, delimiter='\t', reader=reader) |
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 json | |
import re | |
import sys | |
def repl(match): | |
return ':"{0}"{1}'.format( | |
match.group(1), | |
match.group(2)) | |
text = re.sub(r':([0-9A-Za-z]+)([,}])', repl, sys.stdin.readline()) |
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
sudo apt-get -y install libopencv-dev python-opencv |
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
export TARGET_VERTX_VERSION='3.2.1' | |
cd $HOME | |
curl -L -O https://bintray.com/artifact/download/vertx/downloads/vert.x-$TARGET_VERTX_VERSION.tar.gz | |
tar zxvf vert.x-$TARGET_VERTX_VERSION.tar.gz | |
rm vert.x-$TARGET_VERTX_VERSION.tar.gz | |
export PATH=$HOME/vertx/bin:$PATH | |
echo 'Ready for running!' | |
vertx --version |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from cvwrapper import AndroidAgent, Image | |
# Create agent | |
agent = AndroidAgent() | |
# Capture image | |
image = agent.capture() |
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 redis | |
import time | |
def snowflake(redis, epoch=0): | |
return redis.register_script(f""" | |
local node = tonumber(redis.call('HGET', 'globals', 'node')) % 1024 | |
local seq = tonumber(redis.call('HINCRBY', 'globals', 'sequence', 1)) % 4096 | |
local time = redis.call('TIME') | |
local time41 = ((tonumber(time[1]) * 1000) + (tonumber(time[2]) / 1000)) - {epoch} |
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 hmac | |
from datetime import datetime, timedelta | |
from hashlib import sha256 | |
class Session: | |
secret = b'Please enter your desired passphrase' | |
def __init__(self, *, user=None, token=None): | |
if user: |
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
# -*- coding: utf-8 -*- | |
import multiprocessing | |
import subprocess | |
import sys | |
import time | |
class Job: | |
done = False |
OlderNewer