I hereby claim:
- I am haprog on github.
- I am haprog (https://keybase.io/haprog) on keybase.
- I have a public key ASDRDMKacyX-eTdsoX-bvM9Ze-_vkyMUkG9dTNmqKeFPxAo
To claim this, I am signing this object:
| // Returns a new function that will call the given "func" at most once every "wait" milliseconds. | |
| // Based on debounce function from: https://davidwalsh.name/essential-javascript-functions | |
| function rateLimit(func, wait) { | |
| var waiting = false; | |
| return function() { | |
| if (!waiting) { | |
| var waiting = true, context = this, args = arguments; | |
| func.apply(context, args); | |
| setTimeout(function(){ waiting = false; }); | |
| } |
| /** | |
| * Load the given script. | |
| * (appends a new <script> tag to the end of the main document's <head> tag) | |
| * | |
| * @param {string} src URL if the script to be loaded | |
| * @param {?Object} props Properties to be set on the script (e.g. async, defer, onload, onerror) | |
| * @param {?Object} attrs Attributes to be set on the script (e.g. id, data-*) | |
| * @returns {Promise} | |
| */ | |
| let loadScript = (src, props, attrs) => new Promise((resolve, reject) => { |
I hereby claim:
To claim this, I am signing this object:
[2019-05-08] Update: Info on this page is now probably outdated. I might update this later. See: https://webmasters.googleblog.com/2019/05/the-new-evergreen-googlebot.html 🎉
Updated on 2019-01-04
| /** | |
| * This file is intended as a workaround for IDEs (e.g. IntelliJ IDEA) to be | |
| * able to detect the CSS custom properties (variables) declared by | |
| * https://github.com/vaadin/vaadin-lumo-styles/ so that the IDE won't | |
| * complain about unresolved custom properties and you get autocompletion | |
| * for them. | |
| * | |
| * Usage: | |
| * Save this file somewhere in your project where your IDE will find it. | |
| * |
| /** | |
| * A version of querySelectorAll() that also recursively looks into all shadow roots. | |
| * @param selector Selector | |
| * @param root (Optional) Scope of the query (Element or Document). Defaults to the document. | |
| * @returns | |
| */ | |
| function deepQuerySelectorAll(selector, root) { | |
| root = root || document; | |
| const results = Array.from(root.querySelectorAll(selector)); | |
| const pushNestedResults = function (root) { |
Updated: 2022-07
I wrote the first edition of this as a guide for myself at the end of 2017 - it was a mashup of Pi-Hole + PiVPN scripts and an IPsec script installed within a separate Raspian Docker image... and it actually worked!
But things have come a long way, and WireGuard happened - I've since streamlined and simplified my setup into a single Docker Compose script.
The steps below assume the following:
| import { inspect } from 'node:util'; | |
| console.debug( | |
| inspect( | |
| { sheriffConfig }, | |
| { | |
| depth: 5, | |
| colors: true, | |
| maxArrayLength: 200, | |
| }, |
| import type { Linter } from 'eslint'; | |
| import { sheriff } from 'eslint-config-sheriff'; | |
| type SheriffConfig = ReturnType<typeof sheriff>; | |
| type ArrayItem<T> = T extends (infer U)[] ? U : never; | |
| type SheriffConfigItem = ArrayItem<SheriffConfig>; | |
| type RuleName = string; | |
| type RuleUpdater = | |
| | Linter.RuleEntry |