Skip to content

Instantly share code, notes, and snippets.

@nucklearproject
nucklearproject / TTP229_pico_cicuitpython.py
Last active August 17, 2024 18:02
circuitpython TTP229 connect to raspbery pico
import board
import digitalio
import time
# Configurar los pines
sdo_pin = digitalio.DigitalInOut(board.GP19)
sdo_pin.direction = digitalio.Direction.INPUT
sdo_pin.pull = digitalio.Pull.UP
scl_pin = digitalio.DigitalInOut(board.GP18)
@nucklearproject
nucklearproject / USBMIDI_TO_UART.py
Last active August 22, 2024 20:07
Send notes, clock sync, start, stop, etc from midi USB to UART seriall pins on Raspberry pico /// Circuitpython
import board, time
import busio
import usb_midi
from simpleio import map_range
from analogio import AnalogIn
import adafruit_midi
from adafruit_midi.note_off import NoteOff
from adafruit_midi.note_on import NoteOn
from adafruit_midi.polyphonic_key_pressure import PolyphonicKeyPressure
@nucklearproject
nucklearproject / xtt_inference_batch.py
Created August 6, 2024 21:33
Inference and batch txt processing TTS finetuning
import gradio as gr
import os
import tempfile
import torch
import torchaudio
from pathlib import Path
from TTS.tts.configs.xtts_config import XttsConfig
from TTS.tts.models.xtts import Xtts
XTTS_MODEL = None
@nucklearproject
nucklearproject / midoreceive.py
Created September 17, 2023 20:21
Mido python - Receive messages from muiltiple input port and print them out.
"""
Receive messages from muiltiple input port and print them out.
"""
import sys
#from mido.ports import MultiPort
from mido import open_input, get_input_names
ports = get_input_names()
@nucklearproject
nucklearproject / cores.cpp
Created August 17, 2023 00:02
ESP32 support multiples dual core FreeRTOS
#include <Arduino.h>
#include <Wire.h>
// Prueba Multitarea(Hilos)RTOS en Diferente Nucleo ESP32 by: elprofegarcia.com
TaskHandle_t Tarea0; // Tarea0 parpadeo LED 0,3 segundos
TaskHandle_t Tarea1; // Tarea1 parpadeo LED 1 Segundo
// Declaraciones previas
void loop0(void *parameter);
void loop1(void *parameter);
@nucklearproject
nucklearproject / ads.dart
Last active December 26, 2019 14:17
Problema con lag al mostrar ads flutter
import 'package:firebase_admob/firebase_admob.dart';
import '../services/globals.dart';
class Ads {
InterstitialAd myInterstitial;
MobileAdTargetingInfo targetingInfo = new MobileAdTargetingInfo(
testDevices: TEST_DEVICES,
);
@nucklearproject
nucklearproject / test.dart
Created August 10, 2018 01:19
Create a Stack->ListView->Positioned
body: new Stack(
children: <Widget>[
new Container(
decoration: _recursos.backgroundImageComun(),
),
new Column(
children: <Widget>[
new Container(
height: 196.0,
child: new Stack(
@nucklearproject
nucklearproject / ads.dart
Last active November 23, 2019 01:38
Prueba test Flutter positioned into Stack
import 'package:firebase_admob/firebase_admob.dart';
import '../services/globals.dart';
class Ads {
InterstitialAd myInterstitial;
MobileAdTargetingInfo targetingInfo = new MobileAdTargetingInfo(
testDevices: TEST_DEVICES,
/* keywords: <String>[
"tarot",
@nucklearproject
nucklearproject / rows.dart
Created August 5, 2018 01:47
Flutter obtener ID
Container seleccionBlock(double rotacion, double margin, int contador) {
return Container(
margin: EdgeInsets.only(top: margin),
child: Transform.rotate(
angle: rotacion,
child: Container(
width: 110.0,
height: 196.0,
// padding: const EdgeInsets.all(4.0),
@nucklearproject
nucklearproject / WP-no-category.php
Created September 19, 2016 13:19
Worepress - No listar en los posts los posts que no tengan una categoria definida.
//if the post is category "uncategorized" or child of "uncategorized" as the main category, change the permalink rule of "/%category%/%postname%" to "/%postname%"
function my_pre_post_link($permalink, $post, $leavename)
{
if ($post->post_type != 'post') {
return $permalink;
}
$cats = get_the_category($post->ID);
if (!count($cats)) {
return $permalink;
}