Skip to content

Instantly share code, notes, and snippets.

const events = ['mousedown', 'mousemove', 'keypress', 'scroll', 'touchstart'];
// tick timer for schedule jobs
// idle timer autoremove it self after stop
export class IdleTickTimer {
private idleCount: number = 0;
private stopIdleCount: number = 0;
private idleTickCallback: { (tick: number, final: boolean): void };
private intervalID: number;
private activityCallback: { (): void } | null;
import { pbkdf2, randomBytes } from 'crypto';
import { promisify } from 'util';
export interface PBKDF2Options {
digest: string;
iterations: number;
keylen?: number;
}
export class PBKDF2 {
'''
batch change tracker for qbittorrent 4.2-
'''
import sys
import os
import glob
import bencode
if __name__ == '__main__':
@neilzheng
neilzheng / ttc2ttf.py
Created May 2, 2018 04:37 — forked from johnko/ttc2ttf.py
ttc2ttf
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#First released as C++ program by Hiroyuki Tsutsumi as part of the free software suite “Beer”
#I thought porting it to Python could be both a challenge and useful
from sys import argv, exit, getsizeof
from struct import pack_into, unpack_from
def ceil4(n):
#!/usr/bin/env python
import sys
import asyncio
import aiohttp
class Server:
def __init__(self, ws_uri, loop=None, **wskwargs):
#!/usr/bin/env python
import sys
import asyncio
from aiohttp import web
class Server:
def __init__(self, host, port, loop=None, **kwargs):
# -*- coding: utf-8 -*-
import glob
def parse_block(f, info):
block = {}
line = f.readline().strip()
if not line:
return None
# -*-: coding: utf-8 -*-
import asyncio
import aiohttp
import traceback
import datetime
import math
def hsize(s):
suffixs = ["B", "KB", "MB", "GB"]
# -*-: coding: utf-8 -*-
import asyncio
import aiohttp
import traceback
import datetime
import math
def hsize(s):
suffixs = ["B", "KB", "MB", "GB"]
#!/usr/bin/env python
import sys
import asyncio
import websockets
class Server:
def __init__(self, host, port, loop=None, **kwargs):