Skip to content

Instantly share code, notes, and snippets.

Indexed DB - N-Dimensional Selection

The problem

We have an index with keys of the form:

[ dim1, dim2, dim3, ... ]

e.g. created with:

@planeth44
planeth44 / index.js
Created April 5, 2024 08:07 — forked from thomaswilburn/index.js
Classy signals
var tracking = [];
var pending = new Set();
function anticipate(fn) {
pending.add(fn);
requestAnimationFrame(() => {
for (var p of pending) p();
pending.clear();
});
}
@planeth44
planeth44 / dump_routes.php
Created August 24, 2022 18:46 — forked from derrabus/dump_routes.php
Extract Symfony routing configuration from a Silex application
#!/usr/bin/env php
<?php
use Silex\Application;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCompiler;
use Symfony\Component\Yaml\Yaml;
require_once __DIR__ . '/vendor/autoload.php';
@planeth44
planeth44 / watch.sh
Created August 23, 2022 19:15 — forked from lyrixx/watch.sh
Watch dir and copy on change
watch -n 1 cp -u -R ./source ./dest
# Run every seconds: `-n 1`
# Copy everything from "source" to "dest":
# `-R ./source ./dest`
# But only if the content is different `-u`
@planeth44
planeth44 / drip-fetch-all.sh
Created August 29, 2017 09:52 — forked from blangenfeld/drip-fetch-all.sh
Bash script for fetching ALL of a Drip account's "whatevers". Echoes results to stdout as a JSON array as they come in. Not fancy, but it works.
#! /bin/bash
# Bash script for fetching ALL of a Drip account's whatevers to file.
# Not fancy, but it works.
#
# Usage: ./drip-fetch-all.sh <resource>
#
# brian@knotfield.com
RESOURCE=$1 # subscribers, campaigns, tags, ...
@planeth44
planeth44 / zcr_sendGoodies.php
Last active July 1, 2016 15:38
zem_contact_reborn plugin. Send goodies to your users.
<?php
// This is a PLUGIN TEMPLATE for Textpattern CMS.
// Copy this file to a new name like abc_myplugin.php. Edit the code, then
// run this file at the command line to produce a plugin for distribution:
// $ php abc_myplugin.php > abc_myplugin-0.1.txt
// Plugin name is optional. If unset, it will be extracted from the current
// file name. Plugin names should start with a three letter prefix which is
$ = jQuery;
/*
* jQuery BBQ: Back Button & Query Library - v1.3pre - 8/26/2010
* http://benalman.com/projects/jquery-bbq-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/