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