Skip to content

Instantly share code, notes, and snippets.

View jnv's full-sized avatar

Jan Vlnas jnv

View GitHub Profile
@solarkraft
solarkraft / syncthing-automerge.py
Created December 30, 2022 18:00
Monitors a Syncthing-synced directory and tries to merge conflicting files (based on https://www.rafa.ee/articles/resolve-syncthing-conflicts-using-three-way-merge/). Probably adaptable for other directory types, but only tested with Logseq (works for me™️).
import os
import time
import re
import subprocess
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
def get_relative_path(path):
return os.path.relpath(path)
@wtaysom
wtaysom / bel-eve-vr.md
Last active January 24, 2024 03:25
A Review of Paul Graham's Bel, Chris Granger's Eve, and a Silly VR Rant

Hello Friends,

This elf begging to climb onto the web for Christmas began as a personal email, a review of Paul Graham's little Lisp Bel. He sprouted arms, legs, and in gingerstyle ran away. Arms for symbols, legs for conses: these primitives are the mark a Lisp — even more so than the parenthesis. What do we get when we remove these foundation stones: naming and pairing?

No pairs. No cons. No structure. Unordered. Chaos. Eve, a beautifully incomplete aspect oriented triple store. No need for legs when you can effortlessly transport to your destination. Lazy. Pure. Here and now, a retrospective.

No symbols. No names. No variables. Combinators. Forth. No need for arms when you can effortlessly push and pop your stack. No words. A world without words. Virtual worlds. Virtual reality. Space. Time. Motion. Action. Kinetic Programming, a proposal.

I apologize in advance. Checking my pocketwatch, I see I haven't t

@johncip
johncip / phaser-2-to-3.md
Last active March 10, 2024 08:16
Moving from Phaser 2 to 3

Moving from Phaser 2 → 3: an incomplete guide

Summary

  • I found that the best thing was to ask myself what this or that line was meant to accomplish, and then to search labs.phaser.io for a Phaser 3 example of that task.
  • Usually the issue is just that a function has moved, or some property now requires a setter.
  • There's a real migration guide here: part 1, part 2

Scenes have replaced states (and the game object… mostly)

@alfredringstad
alfredringstad / README.md
Created September 25, 2017 13:26
Forking a single package in a monorepo

Forking a single package in a monorepo

The trend of using monorepos makes a lot of things easier to manage. However, when you want to fork a single package inside a monorepo, you'll have to chose one of two options:

  • Fork the entire monorepo (meaning you get all those extra boilerplate you don't really care about)
  • Manually copying the package files into a new git repo (meaning you'll loose all git history and have a lot of work to do when there's a new version of your base package)

The good news: There's a solution for this! And it's actually built in to git.

git subtree

One of the lesser-known (and vaguely documented) features of git is subtree. It's intended for this purpose, working as a great alternative to the criticized submodules. There are very few resources about using this in practice, so here's a guide for this specific use case.

@threepointone
threepointone / alternative.md
Last active July 31, 2022 17:46
list of things that don't do what they say they do

(also know as lies and/or alternative facts)

js

  • setImmediate - doesn't set anything immediately, waits for a tick before executing
  • setTimeout(fn, n) - never sets the timeout to exactly n
  • Math.random() - computers cannot generate random numbers
  • Promise - is a lie when rejected
  • Array.reduce - accumulates, does not reduce (via @sbmadhav)
@ncase
ncase / common-project.md
Last active July 5, 2017 15:33
The Common Project Project (version 0.1)

A country that's polarized is paralyzed. If we want any change in the coming years, we need to find a way to work together. However, you can't just unify people by holding hands and singing Kumbaya. No – rather than ignore or "put aside" our differences, let's use our different perspectives & interests & skills to tackle problems from all possible angles! For us to find common ground, we first need to find common goals.

This is the Common Project project.

Below, you'll find a list of projects, people, organizations, books, talks, movies, articles, and ideas that cross partisan lines to solve The Big Problems we face today. There's many such problems. And we'll need help from all sides.


@marcan
marcan / linux.sh
Last active December 1, 2023 15:18
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@kaugesaar
kaugesaar / GeoSearch.js
Last active October 17, 2021 12:37
Fake your Google searches location with uule parameter.
var GeoSearch = function() {
this.baseUrl = 'https://www.google.se/search?';
this.pws = true;
this.lang = 'sv';
var key = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
var makeHash = function(loc) {
loc = loc.toLowerCase().replace(/[åä]/g,'a').replace(/[ö]/g,'o');
return 'w+CAIQICI' + key[loc.length%key.length] + btoa(loc).replace(/\=/g,'').trim();
@vkostyukov
vkostyukov / statuses.md
Last active February 13, 2024 21:39
HTTP status codes used by world-famous APIs
API Status Codes
[Twitter][tw] 200, 304, 400, 401, 403, 404, 406, 410, 420, 422, 429, 500, 502, 503, 504
[Stripe][stripe] 200, 400, 401, 402, 404, 429, 500, 502, 503, 504
[Github][gh] 200, 400, 422, 301, 302, 304, 307, 401, 403
[Pagerduty][pd] 200, 201, 204, 400, 401, 403, 404, 408, 500
[NewRelic Plugins][nr] 200, 400, 403, 404, 405, 413, 500, 502, 503, 503
[Etsy][etsy] 200, 201, 400, 403, 404, 500, 503
[Dropbox][db] 200, 400, 401, 403, 404, 405, 429, 503, 507
@maximilianschmitt
maximilianschmitt / readme.md
Last active August 29, 2015 14:19
Compiling your ES6 command line apps to work with node.js