This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <setjmp.h> | |
#define MAX_AWAIT_JMP 8 | |
static int throw_signal; | |
static jmp_buf main_jmp; |
This file contains 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 uwebsockets.client | |
import time | |
import network | |
import urequests | |
import micropython | |
DEFAULT_ESSID = 'network-esp8266' | |
DEFAULT_PASSWORD = 'ultra-secret-password' |
This file contains 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 asyncio | |
import enum | |
class StateMachine(enum.Enum): | |
INIT = 0 | |
RUN = 1 | |
WAIT = 2 | |
This file contains 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 ctypes | |
import dataclasses | |
import string | |
import sys | |
import typing | |
import sdl2 | |
import sdl2.sdlttf as ttf | |
WINDOW_SIZE_WIDTH, WINDOW_SIZE_HEIGHT = 640, 480 |
This file contains 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 json | |
import falcon | |
import falcon.asgi | |
import peewee | |
DATABASE_FILENAME = "cybercoffee.db" | |
class Singleton(type): |
This file contains 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 contextlib | |
import numpy as np | |
import pyaudio | |
from tensorflow import keras | |
CHUNK = 1024 | |
FORMAT = pyaudio.paInt16 | |
CHANNELS = 1 | |
RATE = 44100 |
This file contains 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 ctypes | |
import string | |
import sdl2 | |
import sdl2.sdlttf as sdlttf | |
DEFAULT_FONT = "ModernDOS8x16.ttf" | |
DEFAULT_PTSIZE = 16 | |
DEFAULT_ALL_ASCII = string.printable |
This file contains 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 heapq | |
def find_shortest_path_dijkstra(maze, start, end): | |
""" | |
Find shortest path with dijkstra algorithm | |
:param maze: List[List[int]] | |
:param start: Tuple[int, int] | |
:param end: Tuple[int, int] |
This file contains 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 importlib | |
import importlib.util | |
from typing import Optional, Any, List, Type, TypeVar, Generic, Dict, Callable, Tuple | |
C = TypeVar('C') | |
def exists_module(name: str | Tuple[str, ...]) -> bool: | |
_module = None |
This file contains 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 typing import Generic, TypeVar, Dict, Protocol, Optional | |
F = TypeVar("F") | |
class DefineDerivationFunction(Generic[F]): | |
def __init__(self, define: str): | |
self.__index_func: Dict[str, F] = {} | |
self.current_define = define |