Skip to content

Instantly share code, notes, and snippets.

@laalaguer
laalaguer / VeChainRandom.sol
Last active February 26, 2022 11:35
Random Number Generation on VeChain
pragma solidity >=0.5.3 <=0.6.4;
contract Extension {
function blake2b256(bytes memory data) public view returns(bytes32);
function blockID(uint num) public view returns(bytes32);
function blockTotalScore(uint num) public view returns(uint64);
function blockTime(uint num) public view returns(uint);
function blockSigner(uint num) public view returns(address);
function totalSupply() public view returns(uint256);
function txProvedWork() public view returns(uint256);
Template
{"NAME":"Tuya Siren","GPIO":[255,107,255,108,255,255,0,0,255,255,255,255,255],"FLAG":0,"BASE":54}
You must activate the template before using any of the tuya commands below.
Recommended rules for tasmota:
rule1 on system#boot backlog tuyasend4 102,0; tuyasend2 103,300; TuyaSend1 117,0 endon
rule1 1
tuyamcu 11,104
@Birdi7
Birdi7 / callback_data_factory_simple.py
Last active October 29, 2024 18:25
A simple example of usage of callback data factory from aiogram
"""
This is a simple example of usage of CallbackData factory
For more comprehensive example see callback_data_factory.py
"""
import asyncio
import logging
from aiogram import Bot, Dispatcher, executor, types
from aiogram.contrib.fsm_storage.memory import MemoryStorage