Skip to content

Instantly share code, notes, and snippets.

@marschr
marschr / ytdl.sh
Last active April 14, 2021 14:41
youtube-dl quick helper script (defaults to 1080p)
#!/bin/bash
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
DEFAULT_RES=1080
usage()
{
# Display Help
@marschr
marschr / arduino_vref.cpp
Last active September 10, 2019 17:04
Arduino internal VRef (Atmega 328/328P based board only)
//Code from: https://code.google.com/archive/p/tinkerit/wikis/SecretVoltmeter.wiki
#include <Arduino.h>
//Reads internal Arduino VRef
long readVcc() { long result;
// Read 1.1V reference against AVcc
ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
delay(2);
// Wait for Vref to settle
ADCSRA |= _BV(ADSC);
let els;
function set_els (els_class) {
els = Array.prototype.slice.call(document.getElementsByClassName(els_class));
}
function click_els (els) {
for (var i = els.length - 1; i >= 0; i--) {
els[i].click();
};
}
@marschr
marschr / bigled.ino
Created January 30, 2018 04:08
Big Led 2
#include "FastLED.h"
#define NUM_LEDS_PER_STRIP 107
CRGB leds[NUM_LEDS_PER_STRIP];
void setup() {
FastLED.addLeds<WS2812, 3, GRB>(leds, NUM_LEDS_PER_STRIP);
FastLED.addLeds<WS2812, 5, GRB>(leds, NUM_LEDS_PER_STRIP);
}