This file contains hidden or 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
struct SHA256_CTX { | |
data : array<u32, 64>, | |
datalen : u32, | |
bitlen : array<u32, 2>, | |
state : array<u32, 8>, | |
info : u32, | |
}; | |
fn sha256_init_ctx(ctx : ptr<function, SHA256_CTX>) | |
{ |
This file contains hidden or 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
from types import ModuleType | |
def import_submodules(module: ModuleType) -> None: | |
""" | |
Import all submodules of a module, recursively, including subpackages. | |
:param module: module (package) to import submodules of | |
""" | |
import importlib | |
import pkgutil |
This file contains hidden or 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
""" | |
This is a serializer / deserializer for the RESP3 protocol. | |
protocol spec at https://github.com/antirez/RESP3/blob/master/spec.md | |
""" | |
from typing import Generator, BinaryIO, Any | |
class error_str(str): | |
pass |
This file contains hidden or 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
""" | |
try to display an image in terminal using vt100 256 color codes | |
""" | |
import os, sys | |
from PIL import Image | |
#~dep:colored | |
from colored import Back, Style | |
from typing import TextIO |
This file contains hidden or 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 re | |
import requests | |
import logging | |
from urllib.parse import urljoin | |
import asyncio | |
import websockets | |
from http import HTTPStatus | |
from asgiref.typing import ( | |
ASGI3Application, |
This file contains hidden or 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
from cvzone.FaceMeshModule import FaceMeshDetector | |
import cv2 | |
cap = cv2.VideoCapture(0) | |
detector = FaceMeshDetector(maxFaces=2) | |
while True: | |
success, img = cap.read() | |
img, faces = detector.findFaceMesh(img) | |
if faces: | |
print(faces[0]) |
This file contains hidden or 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
################################################################################ | |
## compile quickjs as a static library | |
set(QUICKJS_GIT_TAG master) | |
include(FetchContent) | |
FetchContent_Declare( | |
quickjs | |
GIT_REPOSITORY https://github.com/bellard/quickjs.git | |
GIT_TAG ${QUICKJS_GIT_TAG} |
This file contains hidden or 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
#ADD data/ca-bundle.crt /usr/share/ca-certificates/mycompany/ca-bundle.crt | |
#RUN << EOF | |
cd /usr/share/ca-certificates/mycompany | |
i=1; while openssl x509 -out cert$i.pem; do | |
echo mycompany/cert$i.pem >> /etc/ca-certificates.conf | |
i=$((i+1)) | |
done < ca-bundle.crt | |
update-ca-certificates | |
#EOF |
This file contains hidden or 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
# - Find lemon executable and provides macros to generate custom build rules | |
# The module defines the following variables: | |
# | |
# LEMON_EXECUTABLE - path to the LEMON program | |
# LEMON_VERSION - version of LEMON | |
# LEMON_FOUND - true if the program was found | |
# | |
# If LEMON is found, the module defines the macro: | |
# | |
# LEMON_TARGET(<Name> <LEMONInp>) |
This file contains hidden or 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
#include <ESP8266WiFi.h> | |
extern "C" { | |
#include "user_interface.h" | |
#include "wpa2_enterprise.h" | |
#include "c_types.h" | |
} | |
// SSID to connect to | |
char ssid[] = "TEST_KRA"; |
NewerOlder