Skip to content

Instantly share code, notes, and snippets.

@siers
siers / NaiveCopy.hs
Created January 4, 2024 12:51
Naive directory tree copy with full contents in memory and using recursion schemes (cata/anaM)
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UnicodeSyntax #-}
@siers
siers / gist:63df7694c42062349c57c89969a9fbc7
Created August 27, 2024 14:08
nix-shell --run 'python -m uploadserver' oneliner
nix-shell -E 'with (import <nixpkgs> {}); with python3; mkShell { buildInputs = [ (withPackages (p: [(pkgs.buildPythonPackage rec { pname = "uploadserver"; version = "5.2.1"; src = fetchPypi { inherit pname version; hash = "sha256-qp2xkzLvnrnx8dHZpwlF3RjRg8jYC7WAaVS4ltJFZaU="; }; })]) ) ]; }' --run "python -m uploadserver 65353"
# you're welcome
@siers
siers / 2025-05-17-dual-dictionary.html
Last active June 3, 2025 08:59
local dual wiktionary viewer
<!DOCTYPE html>
<meta charset="utf-8">
<script>
let counter = 0
function wordChange() {
counter += 1
let lastCounter = counter
setTimeout(() => { if (lastCounter == counter) applyWord() }, 300)
}