Skip to content

Instantly share code, notes, and snippets.

View shuantsu's full-sized avatar

Filipe Teixeira shuantsu

View GitHub Profile
@shuantsu
shuantsu / table.csv
Created August 26, 2025 13:16
sdl codes javascript correpondence
scancode valor javascript_code
SDL_SCANCODE_UNKNOWN 0 Unidentified
SDL_SCANCODE_A 4 KeyA
SDL_SCANCODE_B 5 KeyB
SDL_SCANCODE_C 6 KeyC
SDL_SCANCODE_D 7 KeyD
SDL_SCANCODE_E 8 KeyE
SDL_SCANCODE_F 9 KeyF
SDL_SCANCODE_G 10 KeyG
SDL_SCANCODE_H 11 KeyH
import cv2
import mediapipe as mp
import numpy as np
from PIL import Image, ImageDraw, ImageFont
import screeninfo
import pyautogui # Importa a biblioteca para controle do mouse
# Configurações do PyAutoGUI
pyautogui.FAILSAFE = False # Desabilita o fail-safe para evitar interrupções por movimentação do mouse para os cantos
pyautogui.PAUSE = 0.001 # Define um pequeno atraso entre as ações do mouse
@shuantsu
shuantsu / AndroidManifest.xml
Last active December 11, 2024 09:41
chaquopy snippets
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:usesCleartextTraffic="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
// Utility micro library "LocalStorj"
const LocalStorj = {
get: (key, defaultValue = null) => {
const result = localStorage.getItem(key)
if (result === null) {
return defaultValue;
}
return result;

ANDROID KOTLIN SWIPE TO REFRESH IMPLEMENTATION


Adicionar ao app o recurso de deslizar para atualizar

dependencies {
    implementation(libs.androidx.swiperefreshlayout)
}

KOTLIN + OKHTTP3


Dependency

com.squareup.okhttp3:okhttp:4.12.0

Get

KOTLIN WEBVIEW (HTML+CSS+JS HYBRID ANDROID APP)


Useful snippets

MainActivity.kt

@shuantsu
shuantsu / app.py
Last active February 28, 2025 15:37
Sintetizador de voz da microsoft edge em script Python
'''
exemplo de uso: python app.py artigo.txt
lembre de instalar esses módulos:
asyncio
edge_tts
@shuantsu
shuantsu / main.py
Created September 5, 2023 01:36
total audio length
import tinytag
import glob
import sys
def get_mp3_duration(filename):
"""Function to get the duration of an MP3 file using TinyTag"""
tag = tinytag.TinyTag.get(filename)
return tag.duration
def format_duration_in_minutes_seconds(seconds):