Skip to content

Instantly share code, notes, and snippets.

@pesterhazy
pesterhazy / six-questions.md
Last active June 15, 2025 14:55
Eli Goldratt's six questions about a new technology
  1. What is the power of the technology?
  2. What limitation does it diminish?
  3. What are the old rules that accommodated the old limitation?
  4. What are the new rules that should be used now?
  5. In light of the new rules, what changes are required in the technology?
  6. How to cause the change to take advantage of the new technology?

Source: Eli Goldratt, Beyond the Goal

@pesterhazy
pesterhazy / building-sync-systems.md
Last active July 3, 2025 14:34
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@mmontone
mmontone / quicksearch.el
Last active May 7, 2021 13:39
Emacs/SLIME frontend to Quicksearch, a search-engine-interface for Common Lisp.
;; Copyright (C) 2021 Mariano Montone
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@dangom
dangom / org-roam-weeklies.el
Created February 4, 2021 03:43
Weekly notes for org-roam
;;; org-roam-weeklies.el --- Weekly-notes for Org-roam -*- coding: utf-8; lexical-binding: t; -*-
;;;
;; Copyright © 2020 Jethro Kuan <[email protected]>
;; Copyright © 2020 Leo Vivier <[email protected]>
;; Author: Jethro Kuan <[email protected]>
;; Leo Vivier <[email protected]>
;; URL: https://github.com/org-roam/org-roam
;; Keywords: org-mode, roam, convenience
;; Version: 1.2.3
@pesterhazy
pesterhazy / indexeddb-problems.md
Last active July 2, 2025 19:28
The pain and anguish of using IndexedDB: problems, bugs and oddities

This gist lists challenges you run into when building offline-first applications based on IndexedDB, including open-source libraries like Firebase, pouchdb and AWS amplify (more).

Note that some of the following issues affect only Safari. Out of the major browsers, Chrome's IndexedDB implementation is the best.

Backing file on disk (WAL file) keeps growing (Safari)

When this bug occurs, every time you use the indexeddb, the WAL file grows. Garbage collection doesn't seem to be working, so after a while, you end up with gigabytes of data.

Random exceptions when working with a large number of indexeddb databases (Safari)

@purcell
purcell / taskqueues.sql
Last active March 19, 2021 08:35
Easy task queues using PostgreSQL
-- Let's say you have a table full of work:
CREATE TABLE tasks (
id UUID PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(),
status TEXT NOT NULL DEFAULT 'pending',
payload JSON NOT NULL, -- or just have meaningful columns!
created_at TIMESTAMP NOT NULL DEFAULT NOW()
);
@purcell
purcell / migrations.sql
Last active September 16, 2017 10:10
PostgreSQL schema migrations system
This code now lives in its own repo at https://github.com/purcell/postgresql-migrations
@mrkgnao
mrkgnao / IosevkaConfigGen.hs
Last active February 25, 2025 07:23
Render Iosevka ligatures to Private Use Area glyphs, for Emacs
{-# LANGUAGE RecordWildCards, Arrows #-}
import Numeric
import Data.Char
import Control.Monad
import Data.Monoid ((<>))
import Data.List (nub, sort, reverse)
data RepeatBounds = RB
@paulirish
paulirish / what-forces-layout.md
Last active July 4, 2025 06:51
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@webcss
webcss / eventsmixin.js
Last active August 9, 2016 12:44
PubSub mixin using CustomEvents
// utilizes the browser eventsystem
// usefull in cases where you need communication between independent components
// registered events are automatically removed onunload with preserving any other onunload handler
var eventsMixin = function(target) {
var _subscriptions = [];
target.broadcast = function(type, payload) {
var ev = new CustomEvent(type, {
detail: payload,