Skip to content

Instantly share code, notes, and snippets.

View mrienstra's full-sized avatar

Michael Rienstra mrienstra

  • Olympic Peninsula, WA
View GitHub Profile
@mrienstra
mrienstra / unregisterServiceWorkers.js
Created February 4, 2018 22:10
Unregister service workers, verbose
navigator.serviceWorker.getRegistrations().then(function (registrations) {
if (!registrations.length) {
console.log('No serviceWorker registrations found.')
return
}
for(let registration of registrations) {
registration.unregister().then(function (boolean) {
console.log(
(boolean ? 'Successfully unregistered' : 'Failed to unregister'), 'ServiceWorkerRegistration\n' +
(registration.installing ? ' .installing.scriptURL = ' + registration.installing.scriptURL + '\n' : '') +
@mrienstra
mrienstra / asdf_list_all_flutter.txt
Created April 23, 2020 21:41
Output from `asdf list all flutter`
.17.0-3.2.pre-beta
.17.0-dev.0.0-dev
.17.0-dev.1.0-dev
.17.0-dev.2.0-dev
.17.0-dev.3.0-dev
.17.0-dev.3.1-beta
.17.0-dev.4.0-dev
.17.0-dev.5.0-dev
.18.0-6.0.pre-dev
.18.0-dev.0.0-dev
await new Promise(function (resolve) {
setTimeout(function () {
resolve();
}, 1000);
});
// ... Can be shortened to:
await new Promise(function (resolve) {
setTimeout(resolve, 1000);
@mrienstra
mrienstra / astro_markdown_files.md
Last active September 19, 2022 19:30
Astro .md files
// preview controller
(() => {
interface MarkdownConfig {
scrollSync?: boolean;
}
class PreviewController {
/**
* Scroll map that maps buffer line to scrollTops of html elements
*/
const colors = {
grey: 90,
red: 31,
yellow: 33,
blue: 34,
purple: 35,
cyan: 36,
white: 37,
};
@mrienstra
mrienstra / dist > Counter.232eec27.js
Created November 10, 2022 06:58
Astro Svelte duplication test
/* empty css */ function L() {}
function nt(t, e) {
for (const n in e) t[n] = e[n];
return t;
}
function Q(t) {
return t();
}
function z() {
return Object.create(null);