Moved this gist content to https://github.com/s-light/SaBoT_hacks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int BUFFER_SIZE = 14; // RFID DATA FRAME FORMAT: 1byte head (value: 2), 10byte data (2byte version + 8byte tag), 2byte checksum, 1byte tail (value: 3) | |
const int DATA_SIZE = 10; // 10byte data (2byte version + 8byte tag) | |
const int DATA_VERSION_SIZE = 2; // 2byte version (actual meaning of these two bytes may vary) | |
const int DATA_TAG_SIZE = 8; // 8byte tag | |
const int CHECKSUM_SIZE = 2; // 2byte checksum | |
uint8_t buffer[BUFFER_SIZE]; // used to store an incoming data frame | |
int buffer_index = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LiquidCrystal_PCF8574.h> | |
#include <Wire.h> | |
// LiquidCrystal_PCF8574 lcd(LCD_ADDRESS); → Default = 0x27; | |
LiquidCrystal_PCF8574 lcd(0x27); | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("LiquidCrystal_PCF8574__HelloWorld"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# minimal test for NeoPixels on Raspberry Pi | |
import time | |
import board | |
import neopixel | |
num_pixels = 2 | |
pixels = neopixel.NeoPixel( | |
board.D18, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name rmv_query_link.js | |
// @description add button to get a link to the current search query | |
// @namespace https://github.com/s-light | |
// @include https://www.rmv.de/* | |
// @version 0.43.0 | |
// require https://s-light.github.io/xyz/script.js | |
// | |
// https://wiki.greasespot.net/Metadata_Block#.40require | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replace_in_textnodes(search_string, replace_string) { | |
console.group('replace_in_pre'); | |
// based on: https://stackoverflow.com/a/10730777/574981 | |
const walk = document.createTreeWalker( | |
document, | |
NodeFilter.SHOW_TEXT, | |
null, | |
false | |
); | |
let replace_counter = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AvahiDiscoveryAgent::AvahiDiscoveryAgent() | |
: m_threaded_poll(avahi_threaded_poll_new()), | |
m_client(NULL), | |
m_reconnect_timeout(NULL), | |
m_backoff(new ExponentialBackoffPolicy(TimeInterval(10, 0), | |
TimeInterval(600, 0))) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LINE124.. | |
AvahiDiscoveryAgent::AvahiDiscoveryAgent() | |
: m_threaded_poll(avahi_threaded_poll_new()), | |
m_client(NULL), | |
m_reconnect_timeout(NULL), | |
m_backoff(new ExponentialBackoffPolicy(TimeInterval(10000000, 0), | |
TimeInterval(600000000, 0))) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
light@stefan-Latitude-E6510:~/ola (APA102PixelBrightness)$ ./olad/olad -l4 2>&1 | ts "%H:%M:%.S" | |
12:24:31.007285 olad/Olad.cpp:94: OLA Daemon version 0.10.6 | |
12:24:31.019336 common/io/EPoller.cpp:82: EPOLL_CTL_ADD 5, events 2001, descriptor: 0x42388 | |
12:24:31.019652 olad/OlaDaemon.cpp:121: Using configs in /home/light/.ola | |
12:24:31.019917 common/io/EPoller.cpp:82: EPOLL_CTL_ADD 8, events 2001, descriptor: 0x3bd48 | |
12:24:31.020256 common/thread/Thread.cpp:194: Thread pref-saver, policy SCHED_OTHER, priority 0 | |
12:24:31.671773 common/rdm/PidStoreLoader.cpp:271: Loading DISC_UNIQUE_BRANCH | |
12:24:31.672430 common/rdm/PidStoreLoader.cpp:271: Loading DISC_MUTE | |
12:24:31.672842 common/rdm/PidStoreLoader.cpp:271: Loading DISC_UN_MUTE | |
12:24:31.673146 common/rdm/PidStoreLoader.cpp:271: Loading PROXIED_DEVICES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
light@stefan-Latitude-E6510:~/ola (AvahiTest *)$ date; ./olad/olad -l4; date | |
Mon Jan 22 16:19:57 CET 2018 | |
olad/Olad.cpp:94: OLA Daemon version 0.10.5 | |
common/io/EPoller.cpp:82: EPOLL_CTL_ADD 5, events 2001, descriptor: 0x42388 | |
olad/OlaDaemon.cpp:121: Using configs in /home/light/.ola | |
common/io/EPoller.cpp:82: EPOLL_CTL_ADD 8, events 2001, descriptor: 0x3bd48 | |
common/thread/Thread.cpp:194: Thread pref-saver, policy SCHED_OTHER, priority 0 | |
common/rdm/PidStoreLoader.cpp:271: Loading DISC_UNIQUE_BRANCH | |
common/rdm/PidStoreLoader.cpp:271: Loading DISC_MUTE | |
common/rdm/PidStoreLoader.cpp:271: Loading DISC_UN_MUTE |
NewerOlder