env GOOS=target-OS GOARCH=target-architecture go build package-import-path
# Example
env GOOS=darwin GOARCH=amd64 go build
env GOOS=darwin GOARCH=amd64 go build main.go
env GOOS=darwin GOARCH=amd64 go build github.com/zoo/york/foo/bar
/var/log/supervisor/*.log { | |
weekly | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
missingok | |
copytruncate | |
} |
import asyncio | |
from asyncio.queues import Queue | |
TERMINATOR = object() | |
class TaskPool(object): | |
def __init__(self, loop, num_workers): | |
self.loop = loop | |
self.tasks = Queue(loop=self.loop) |
import asyncio | |
from collections import deque | |
class AsyncioPool: | |
def __init__(self, concurrency, loop=None): | |
""" | |
@param loop: asyncio loop | |
@param concurrency: Maximum number of concurrently running tasks | |
""" |
""" | |
This gist shows how to run asyncio loop in a separate thread. | |
It could be useful if you want to mix sync and async code together. | |
Python 3.7+ | |
""" | |
import asyncio | |
from datetime import datetime | |
from threading import Thread | |
from typing import Tuple, List, Iterable |
from glob import glob | |
import multiprocessing | |
from concurrent.futures import ProcessPoolExecutor | |
import cv2 | |
from PIL import Image | |
import imagehash | |
from tqdm import tqdm |
[package] | |
name = "test" | |
version = "0.1.0" | |
authors = ["YOU <YOU@users.noreply.github.com>"] | |
edition = "2018" | |
[lib] | |
crate-type = ["cdylib"] |
import time | |
import uuid | |
class PrintRandom(object): | |
def execute(self) -> None: | |
while True: | |
self.print_number(uuid.uuid1().int) | |
time.sleep(1) |
var ARRAY_LENGTH = 16; | |
var MIN_HEX_LENGTH = 2; | |
class UUID { | |
static createUUID() { | |
const array = new Uint8Array(ARRAY_LENGTH); | |
window.crypto.getRandomValues(array); | |
let uuid = ''; |
""" | |
Example of using sub-parser, sub-commands and sub-sub-commands :-) | |
""" | |
import argparse | |
def main(args): | |
""" | |
Just do something |