Skip to content

Instantly share code, notes, and snippets.

@Avaq
Avaq / directories-my.sql
Last active February 16, 2019 21:23
Nested Directory Structure in SQL
-- Create our directories table.
CREATE TABLE `directories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`lft` int(11) NOT NULL,
`rgt` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `directory_lft` (`lft`),
UNIQUE KEY `directory_rgt` (`rgt`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active October 8, 2025 20:58
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@Avaq
Avaq / algebraic-laws.md
Last active February 19, 2025 09:50
Algebraic Law Cheatsheet

Algebraic Law Cheatsheet

An overview of algebraic laws from the perspective of a functional programmer. I've used a Haskell-esque syntax for the definitions of the laws and examples.

General Laws

name definition example
Identity [¹][] f x = x add 0 42 = 42
@colelawrence
colelawrence / effect-rpc-http-example.ts
Last active July 31, 2025 12:36
Effect RPC (RpcServer.layerHttpRouter), HttpApi, HttpLayerRouter example with toWebHandler (with Bun.serve)
// ============================================================================
// PACKAGE VERSIONS (2025-07-30)
// ============================================================================
//
// Dependencies:
// - effect: 3.17.3
// - @effect/platform: 0.90.0
// - @effect/rpc: 0.68.0
//
// ============================================================================