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
FROM docker.io/python:3.9-bullseye AS build | |
WORKDIR "/app" | |
# Install dependecies | |
# hadolint ignore=DL3008,DL3013 | |
RUN set -eux && \ | |
apt-get update; \ | |
apt-get install --no-install-recommends -y \ | |
python3-dev build-essential patchelf upx; \ | |
apt-get clean; \ |
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 = ''; |
from pyrogram import Client, filters | |
app = Client('CONVERSATION_EXAMPLE') | |
conversations = {} | |
infos = {} | |
def conv_filter(conversation_level): | |
def func(_, __, message): | |
return conversations.get(message.from_user.id) == conversation_level |
""" | |
Example of using sub-parser, sub-commands and sub-sub-commands :-) | |
""" | |
import argparse | |
def main(args): | |
""" | |
Just do something |
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) |
[package] | |
name = "test" | |
version = "0.1.0" | |
authors = ["YOU <YOU@users.noreply.github.com>"] | |
edition = "2018" | |
[lib] | |
crate-type = ["cdylib"] |
from glob import glob | |
import multiprocessing | |
from concurrent.futures import ProcessPoolExecutor | |
import cv2 | |
from PIL import Image | |
import imagehash | |
from tqdm import tqdm |
""" | |
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 |