Skip to content

Instantly share code, notes, and snippets.

View maximeborges's full-sized avatar

Maxime BORGES maximeborges

View GitHub Profile
@maximeborges
maximeborges / Sankey diagram.md
Last active April 16, 2025 17:11
Sankey Diagram with Google Spreadsheets

image

Sankey Diagrams within Google Spreadsheets

This Gist is there to help you creating a Sankey Diagram from your Google Spreadsheets.

Demo

Easy way

@maximeborges
maximeborges / hdmi_switch_signals_plot.py
Created December 15, 2023 04:15
PTL HDMI switch remote signals plot
import matplotlib.pyplot as plt
signals = [
("Output A/Input 1\n0x00/0x00", [9070, -4448, 620, -513, 613, -511, 615, -513, 614, -537, 590, -512, 614, -514, 613, -512, 615, -513, 613, -1633, 621, -1632, 620, -1633, 620, -1633, 620, -1633, 620, -1633, 620, -1632, 621, -1633, 620, -537, 590, -513, 614, -511, 615, -514, 612, -511, 616, -511, 616, -516, 611, -510, 616, -1633, 620, -1633, 620, -1633, 621, -1632, 620, -1633, 620, -1633, 620, -1632, 621, -1634, 619]),
("Output A/Input 2\n0x00/0x01", [9068, -4448, 620, -509, 618, -509, 617, -537, 589, -511, 616, -511, 615, -512, 613, -511, 616, -509, 618, -1633, 619, -1632, 621, -1632, 620, -1631, 622, -1632, 621, -1632, 620, -1633, 620, -1632, 620, -1632, 620, -510, 616, -514, 613, -510, 616, -511, 616, -510, 616, -537, 589, -515, 612, -511, 615, -1633, 619, -1633, 620, -1633, 619, -1634, 616, -1636, 617, -1635, 617, -1635, 618]),
("Output A/Input 3\n0x00/0x02", [9042, -4475, 593, -536, 590, -564, 563, -534, 591, -539, 584, -538, 590, -536, 591, -537,
@maximeborges
maximeborges / wakeup.sh
Last active January 26, 2020 22:51
Script using `wakeup` to use my computer as an alarm clock
TIME="07:30"
NEW_VOLUME="36%"
WAKE_VOLUME="45%"
# Check if the time is still today or tomorrow
if [ $(($(date -d "$TIME" +%s)-$(date +%s))) -lt 0 ]
then
TOMORROW="TOMORROW"
fi
@maximeborges
maximeborges / Dragino v1.3 RFM98W.ino
Last active January 21, 2018 13:06
Dragino v1.3 RFM98W Sender
// Install the LoRa library by Sandeep Mistry via the Arduino interface (https://github.com/sandeepmistry/arduino-LoRa)
#include <SPI.h>
#include <LoRa.h>
int counter = 0;
void setup() {
Serial.begin(115200);
while (!Serial);
@maximeborges
maximeborges / blinking throwies attiny9.c
Created September 24, 2017 19:11
Blinking Throwies for ATtiny9
#include <avr/interrupt.h>
#include <avr/sleep.h>
#define LED PB0
#define LED_POWER 100 // From 0 to 255
volatile uint8_t flag = 0;
// See Table 9-3. Watchdog Timer Prescale Select in ATtiny9 datasheet for Watchdog Timeout values
ISR(WDT_vect) {
@maximeborges
maximeborges / Cordwood Puzzle Too - Arduino Random.ino
Created May 20, 2017 12:45
Cordwood Puzzle Too - Arduino Random
uint8_t r;
void setup() {
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
@maximeborges
maximeborges / Bitset without padding.cpp
Last active April 1, 2017 17:25
Bitset without padding
#include <bitset>
#include <cstdint>
#include <iostream>
using namespace std;
struct __attribute__((packed)) Data {
uint32_t timestamp : 32;
uint32_t gpsLat : 24;
uint32_t gpsLong : 24;
@maximeborges
maximeborges / draw_wave.py
Last active January 22, 2016 17:38
Draw points cloud and save to stereo wav file
import numpy as np
import matplotlib.pyplot as plt
left = list()
right = list()
# Read data from a file
# dataread = np.fromfile("test.wav", dtype='<i2')
# for i in range(22, 198):
# if i%2: