Skip to content

Instantly share code, notes, and snippets.

@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;
}
@nucklearproject
nucklearproject / admin-genesis-functions.php
Created September 19, 2016 13:17
Base para Genesis framework
<?php
function be_megasense_defaults($defaults)
{
$defaults['ad_post_align'] = 'left';
$defaults['disquss-name'] = '';
$defaults['facebook-appid'] = '';
$defaults['default-comment'] = 'default';
$default['show_author'] = '1';
@nucklearproject
nucklearproject / gist:c4f845963bbeee624056
Last active August 29, 2015 14:18
Reemplazar la url de una pagina por la categoria para SILO
function wpa_alter_cat_links( $termlink, $term, $taxonomy ){
if( 'category' == $taxonomy && 0 == $term->parent ){
return str_replace( '/category', '', $termlink );
}
return $termlink;
}
add_filter( 'term_link', 'wpa_alter_cat_links', 10, 3 );
@nucklearproject
nucklearproject / gist:5406964
Created April 17, 2013 19:19
Javascript with detect
// Manages changes in responsive layout
var layout = (function() {
var callbacks = [];
// Container for checking changes in layout width
var $container = $('#header .container');
// Container width: screen width
var steps = {
960: 960,