Skip to content

Instantly share code, notes, and snippets.

@gamb
gamb / building-sync-systems.md
Created March 12, 2024 15:58 — forked from pesterhazy/building-sync-systems.md
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

Performance is described here: https://magit.vc/manual/magit/Performance.html

Tip: use M-x magit-toggle-verbose-refresh to debug performance.

What worked for me:

  1. Enable fsmonitor
git config core.fsmonitor true
git config core.untrackedcache true

Jump to the next error with C-; then if the next key press is RET open the eglot-code-actions menu at point.

(use-package eglot
  :config
  (defun eglot-code-actions-temporary-map (&rest arg)
    (set-temporary-overlay-map
     (let ((map (make-sparse-keymap)))
       (define-key map (kbd "RET") 'eglot-code-actions)
 map)
@gamb
gamb / merlin-log.txt
Last active May 11, 2019 08:33
Erroring when running `ocamlmerlin -version The Merlin toolkit version %VERSION%, for Ocaml 4.02.3` (Should be 3.2.2)
# calling binary: "ocamlmerlin" with arguments: ("server" "errors" "-protocol" "sexp" "-log-file" "-" "-filename" "/home/gamble/dev/reasonml-playground/src/Greeting.re").
# stdout
((assoc) (class . "exception") (value . "End_of_file
Raised at file \"src/utils/std.ml\", line 656, characters 36-39
Called from file \"src/ocaml/utils/misc.ml\", line 30, characters 20-27
Re-raised at file \"src/ocaml/utils/misc.ml\", line 30, characters 56-57
Called from file \"src/frontend/new/new_merlin.ml\", line 97, characters 18-54
") (notifications) (timing (assoc) (total . 1.822) (query . 1.22) (reader . 0.582) (ppx . 0.012) (typer . 0.008) (error . 0.)))
# stderr
# 0.01 Mconfig - normalize
@gamb
gamb / builder.sh
Last active October 16, 2015 09:54
NixOS package for VIPS (image processing library)
source $stdenv/setup
tar xvfz $src
cd vips*
./configure --prefix=$out
make
make install
@gamb
gamb / nix-support-postgis-2.x.patch
Created January 15, 2015 20:57
nix-support-postgis-2.x.patch
From a2e8454eaad4e8c5b1561836e8c6fb00636ee2a8 Mon Sep 17 00:00:00 2001
From: "Adam Gamble (torpor)" <adam@gamb.co>
Date: Thu, 15 Jan 2015 20:56:06 +0000
Subject: [PATCH] Created PostGIS 2.x
---
pkgs/development/libraries/postgis-2.x/default.nix | 29 ++++++++++++++++++++++
pkgs/development/libraries/proj/default.nix | 6 ++---
pkgs/top-level/all-packages.nix | 2 ++
3 files changed, 34 insertions(+), 3 deletions(-)