Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
nolanlawson / rant.md
Last active March 1, 2023 23:34
Misconceptions about PouchDB

Misconceptions about PouchDB

A quick rant.

  1. PouchDB is slow, because it doesn't use bare-metal IndexedDB

OK, first off I want to point out the CanIUse table for IndexedDB. Go ahead, look at it. I'll wait.

@rmehner
rmehner / delete-databases.js
Last active July 9, 2024 10:35
Delete all indexedDB databases
// Credit to @steobrien from https://gist.github.com/rmehner/b9a41d9f659c9b1c3340#gistcomment-2940034
// for modern browsers, this works:
const dbs = await window.indexedDB.databases()
dbs.forEach(db => { window.indexedDB.deleteDatabase(db.name) })
// for older browsers, have a look at previous revisions of this gist.
@staltz
staltz / introrx.md
Last active November 14, 2024 11:27
The introduction to Reactive Programming you've been missing
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active October 12, 2024 16:34
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@copyriot
copyriot / KOPIERA DETTA BRÖD
Last active December 12, 2015 00:48
Limpor med fikon och morot
VAD BLIR DETTA?
Tre limpor saftigt matbröd, någonstans mellan ljust och mörkt.
INGREDIENSER
2-3 torkade fikon
2-3 morötter
5 dl vatten
ett halvt paket jäst
2 msk matolja
4 deciliter lantbrödsmjöl
@mbostock
mbostock / .block
Last active April 23, 2024 12:30
Hierarchical Edge Bundling
license: gpl-3.0
height: 960
border: no
redirect: https://observablehq.com/@d3/hierarchical-edge-bundling
@minimal
minimal / jetty.clj
Created January 20, 2010 01:17
Websockets with clojure + jetty
;; Copyright (c) James Reeves. All rights reserved.
;; The use and distribution terms for this software are covered by the Eclipse
;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which
;; can be found in the file epl-v10.html at the root of this distribution. By
;; using this software in any fashion, you are agreeing to be bound by the
;; terms of this license. You must not remove this notice, or any other, from
;; this software.
(ns compojure.server.jetty
"Clojure interface to start an embedded Jetty server."