Skip to content

Instantly share code, notes, and snippets.

View SealtielFreak's full-sized avatar
🌴
On vacation

SealtielFreak SealtielFreak

🌴
On vacation
View GitHub Profile
"""
MIT License
Copyright (c) 2023 D. Sealtiel Valderrama
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@SealtielFreak
SealtielFreak / pong.py
Created September 19, 2023 20:18
Pong in Pygame
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import abc
import math
import functools
import pygame
import pygame.locals
import pygame.math
#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;
import uwebsockets.client
import time
import network
import urequests
import micropython
DEFAULT_ESSID = 'network-esp8266'
DEFAULT_PASSWORD = 'ultra-secret-password'
@SealtielFreak
SealtielFreak / scheduler_async.py
Last active June 1, 2023 20:09
skech scheduler, serial testing at commsnds and overflow DMA test
import asyncio
import enum
class StateMachine(enum.Enum):
INIT = 0
RUN = 1
WAIT = 2
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
@SealtielFreak
SealtielFreak / cybercoffee.py
Last active May 18, 2023 19:50
CyberCoffee API Rest (With Falcon and Peewee)
import json
import falcon
import falcon.asgi
import peewee
DATABASE_FILENAME = "cybercoffee.db"
class Singleton(type):
@SealtielFreak
SealtielFreak / inscription_voice.py
Last active April 25, 2023 17:11
Inscription voice with Tensorflow and Pyaduio
import contextlib
import numpy as np
import pyaudio
from tensorflow import keras
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 44100
@SealtielFreak
SealtielFreak / all_fonts.py
Last active March 14, 2023 17:42
pysdl2 fonts
import ctypes
import string
import sdl2
import sdl2.sdlttf as sdlttf
DEFAULT_FONT = "ModernDOS8x16.ttf"
DEFAULT_PTSIZE = 16
DEFAULT_ALL_ASCII = string.printable
@SealtielFreak
SealtielFreak / dikjastra_maze.py
Last active February 28, 2023 20:19
Dikjastra algorithm
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]