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| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "net/http" | |
| "os" | |
| ) | |
| func main() { |
| """ | |
| 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 |
| """ | |
| Example of using sub-parser, sub-commands and sub-sub-commands :-) | |
| """ | |
| import argparse | |
| def main(args): | |
| """ | |
| Just do something |
| from glob import glob | |
| import multiprocessing | |
| from concurrent.futures import ProcessPoolExecutor | |
| import cv2 | |
| from PIL import Image | |
| import imagehash | |
| from tqdm import tqdm |
| sudo apt-get update && sudo apt-get install sox libsox-fmt-all |
| 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 | |
| """ |
| [package] | |
| name = "test" | |
| version = "0.1.0" | |
| authors = ["YOU <YOU@users.noreply.github.com>"] | |
| edition = "2018" | |
| [lib] | |
| crate-type = ["cdylib"] |
| 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 = ''; |
| import time | |
| import uuid | |
| class PrintRandom(object): | |
| def execute(self) -> None: | |
| while True: | |
| self.print_number(uuid.uuid1().int) | |
| time.sleep(1) |