Skip to content

Instantly share code, notes, and snippets.

View ayushsharma82's full-sized avatar
🎯
Focusing

Ayush Sharma ayushsharma82

🎯
Focusing
View GitHub Profile
#define TRIAC_PIN 5
#define ZERO_CROSS_PIN 4
#define DEBOUNCE_TIME 9000 //9ms - 10ms is the pulse period
static uint32_t lastPulse = 0;
static uint16_t period = 5000; //5ms - 50% for each half wave
void ICACHE_RAM_ATTR onTimerISR(){
if(GPIP(TRIAC_PIN)){//OUTPUT is HIGH
GPOC = (1 << TRIAC_PIN);//low
@ayushsharma82
ayushsharma82 / crypto-aes-256-gcm-demo.js
Created March 22, 2019 12:43 — forked from rjz/crypto-aes-256-gcm-demo.js
example using node.js crypto API with aes-256-gcm
const buffer = require('buffer');
const crypto = require('crypto');
// Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib.
const aes256gcm = (key) => {
const ALGO = 'aes-256-gcm';
// encrypt returns base64-encoded ciphertext
const encrypt = (str) => {
// Hint: the `iv` should be unique (but not necessarily random).
@ayushsharma82
ayushsharma82 / proxmox-ubuntu-resize
Created May 1, 2024 10:36 — forked from smashah/proxmox-ubuntu-resize
Resize Ubuntu on proxmox hd size
Based on:
https://gist.github.com/gjrdiesel/4e93d8743b71babb58dcba4ee049247c
https://www.reddit.com/r/Proxmox/comments/hkvl9a/cant_extend_ubuntu_20_lvm_after_expanding_raw_disk/
1.
`lsblk`