View ha_volume_helper_scripts.yaml
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
volume_down: | |
alias: Volume Down | |
description: Volume Down with user defined step size | |
fields: | |
entity_id: | |
selector: | |
entity: | |
domain: media_player | |
step: | |
default: 0.05 |
View printHexdump.c
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
// Quick way to print a hexdump of a buffer. Output will look like this: | |
// | |
// 0 1 2 3 4 5 6 7 8 9 A B C D E F | |
// 0000 54 68 69 73 20 69 73 20 61 20 74 65 73 74 20 68 This is a test h | |
// 0010 65 78 64 75 6D 70 21 20 46 6F 6F 2E 20 01 02 03 exdump! Foo. ... | |
// 0020 04 . | |
inline void printHexdumpAscii(uint16_t index, uint8_t byte) { | |
if (index % 16 == 8) { // some spacing for orientation | |
printf(" "); |
View ttn_mapper_uplink_payload_formatter.js
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
// convert raw data to integer | |
function getVar(inputBytes, offset, varLen, isSigned = false) { | |
let outVal = 0; | |
for (let i = 0; i < varLen; i++) { | |
outVal |= inputBytes[offset + i] << i * 8; | |
} | |
if (isSigned) { // parse as signed value | |
if (inputBytes[offset + varLen - 1] & 0x80) { // sign bit is set | |
outVal = ~(outVal) + 1; // calculate two's complement |
View xpv2bin.py
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
#!/usr/bin/env python3 | |
# Convert XPV/XDV files to binary (CSR Blueflash / Bluecore firmware files) | |
# Quickly hacked together by LeoDJ | |
import sys | |
import os | |
def xpv2bin(input_file, output_file): | |
with open(input_file) as f_in, open(output_file, "wb") as f_out: |
View _cm1106_co2_sensor_esphome.yaml
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
esphome: | |
name: cm1106_sensor | |
platform: ESP32 | |
board: wemos_d1_mini32 | |
includes: | |
- "cm1106.h" | |
wifi: | |
ssid: !secret wifi_ssid | |
password: !secret wifi_pass |
View led_strip.yaml
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
esphome: | |
name: led_strip | |
platform: ESP8266 | |
board: esp01_1m | |
wifi: | |
ssid: "" | |
password: "" | |
# Enable fallback hotspot (captive portal) in case wifi connection fails |
View outPortTester.js
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
var request = require('request'); | |
let blocked = [], open = [] | |
lastPort = 6000 | |
function pingPort(port) { | |
request('http://portquiz.net:' + port, function (err, res, body) { | |
//console.log(err, res, body) | |
if ((!err && res.statusCode == 200) || (err && err.code == 'HPE_INVALID_CONSTANT')) { |
View voltmeter.cpp
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
long readVcc() { | |
// Read 1.1V reference against AVcc | |
// set the reference to Vcc and the measurement to the internal 1.1V reference | |
#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) | |
ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); | |
#elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) | |
ADMUX = _BV(MUX5) | _BV(MUX0); | |
#elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) | |
ADMUX = _BV(MUX3) | _BV(MUX2); | |
#else |
View userChrome.css
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
/* put file in <AppData>/Mozilla/Firefox/Profiles/<yourProfile>/chrome */ | |
/* to correctly display tab title as window title, set browser.tabs.drawInTitlebar to false in about:config */ | |
/* note: since FF 69 you also need to set toolkit.legacyUserProfileCustomizations.stylesheets to true for it to work*/ | |
#main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar { | |
opacity: 0; | |
pointer-events: none; | |
} | |
#main-window:not([tabsintitlebar="true"]) #TabsToolbar { | |
visibility: collapse !important; |
NewerOlder