Skip to content

Instantly share code, notes, and snippets.

View tkroo's full-sized avatar
🐱

David Sullivan tkroo

🐱
View GitHub Profile
@tkroo
tkroo / newinstagrab.js
Last active December 8, 2021 06:46
grab instagram images
javascript:(
function(){
if(document.body.contains(document.getElementById("mydiv"))){
document.getElementById("mydiv").remove()
}
var myobj=[...document.querySelectorAll("img.FFVAD")].reverse();
var mydiv=document.createElement("div");
mydiv.id="mydiv";
mydiv.style.cssText='position:fixed; z-index:99999; padding:10px; max-height:300px; overflow-y:auto;';
document.body.insertBefore(mydiv,document.body.firstChild);
@tkroo
tkroo / checkered.css
Created February 2, 2022 08:34 — forked from dfrankland/checkered.css
CSS Checkered pattern that can be used on all modern browsers.
body {
background-image:
linear-gradient(45deg, #ccc 25%, transparent 25%),
linear-gradient(135deg, #ccc 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #ccc 75%),
linear-gradient(135deg, transparent 75%, #ccc 75%);
background-size:25px 25px; /* Must be a square */
background-position:0 0, 12.5px 0, 12.5px -12.5px, 0px 12.5px; /* Must be half of one side of the square */
}
@tkroo
tkroo / debounce.py
Created January 23, 2023 17:51 — forked from SpotlightKid/debounce.py
Debounced switch using pin and timer IRQs on MicroPython
#
# inspired by: https://forum.micropython.org/viewtopic.php?t=1938#p10931
#
import micropython
try:
from machine import Timer
timer_init = lambda t, p, cb: t.init(period=p, callback=cb)
except ImportError:
from pyb import Timer
const fs = require("fs");
const path = require("path");
const sharp = require("sharp");
const formats = ['avif', 'webp','jpg'];
const formatsQuality = [40, 50, 50];
const myroot = process.env.ELEVENTY_ROOT;
esphome:
name: rotarybutton
friendly_name: rotarybutton
# other configuration snipped...
binary_sensor:
- platform: gpio
name: "Button 1"
id: "button_1"
Array.from(document.styleSheets).filter((sheet) => { try { sheet.cssRules; return true; } catch (err) { console.log(`Due to CORS issues, this script can't access "${sheet.href}"`); return false; }}).map((sheet) => Array.from(sheet.cssRules).map((rule) => rule.type === rule.FONT_FACE_RULE ? rule.cssText : rule.type === rule.STYLE_RULE ? Array.from(document.querySelectorAll(rule.selectorText)).some((node) => node.getBoundingClientRect().top < window.innerHeight && window.getComputedStyle(node).display !== 'none') ? rule.cssText : null : rule.type === rule.MEDIA_RULE ? `@media ${rule.conditionText} {${Array.from(rule.cssRules).map((mediaRule) => mediaRule.type === mediaRule.FONT_FACE_RULE ? mediaRule.cssText : mediaRule.type === mediaRule.STYLE_RULE ? Array.from(document.querySelectorAll(mediaRule.selectorText)).some((node) => node.getBoundingClientRect().top < window.innerHeight && window.getComputedStyle(node).display !== 'none') ? mediaRule.cssText : null : null).filter((mediaRule) => mediaRule != null).join(
@tkroo
tkroo / updater-slash-index.js
Last active December 2, 2023 08:20
electron-updater with confirm dialog
// usage
// in main:
// import { checkForUpdates } from './updater'
// app.whenReady().then(() => {
// ...
// checkForUpdates()
// createWindow()
// ...
// }
// you may need to adjust the getMainWindow function depending on your app
@tkroo
tkroo / ikea-rodret_E2201_ZHA-Z2M_control-anything.yaml
Last active October 20, 2024 08:57 — forked from damru/ikea-rodret_E2201_ZHA-Z2M_control-anything.yaml
IKEA RODRET Dimmer Remote (E2201) - ZHA/Z2M - Control anything
blueprint:
name: IKEA Rodret Dimmer Controls (ZHA/Z2M)
description: "## Control anything with IKEA RODRET Dimmer remote (v1.2)
Only for use with [ZHA](https://www.home-assistant.io/integrations/zha/)
or Zigbee2MQTT (cf [MQTT](https://www.home-assistant.io/integrations/mqtt)
+ [Z2M addon](https://www.zigbee2mqtt.io/guide/installation/03_ha_addon.html)).
@tkroo
tkroo / esphome-web-a8d7b4.yaml
Created October 25, 2024 17:58
esphome esp32s3 capacitive touch
substitutions:
name: esphome-web-a8d7b4
friendly_name: S3mini a8d7b4
esphome:
name: ${name}
friendly_name: ${friendly_name}
min_version: 2024.6.0
name_add_mac_suffix: false
platformio_options:
@tkroo
tkroo / esphome-web-fbb8e8.yaml
Created November 2, 2024 05:12
esphome shtcx update interval from number
substitutions:
name: esphome-web-fbb8e8
friendly_name: mini32-shtc3
esphome:
name: ${name}
friendly_name: ${friendly_name}
min_version: 2024.6.0
name_add_mac_suffix: false
project: