Skip to content

Instantly share code, notes, and snippets.

View deomorxsy's full-sized avatar
🐚
λx.x

deomorxsy

🐚
λx.x
  • PE, Brasil
  • 12:56 (UTC -03:00)
View GitHub Profile
@VictorTaelin
VictorTaelin / collapse_monad.hs
Last active April 14, 2025 15:05
The Collapse Monad
import Control.Monad (ap, forM_)
import qualified Data.Map as M
-- The Collapse Monad
-- ------------------
-- The Collapse Monad allows collapsing a value with labelled superpositions
-- into a flat list of superposition-free values. It is like the List Monad,
-- except that, instead of always doing a cartesian product, it will perform
-- pairwise merges of distant parts of your program that are "entangled"
-- under the same label. Examples:
@Frichetten
Frichetten / k3s_gVisor_install.md
Last active May 15, 2025 22:53
How to install and configure gVisor for K3s

How to install and configure gVisor for K3s

This gist is a quick explainer on how to install and configure gVisor on K3s. There is a sort of hidden gotcha if you aren't reading the documentation thoroughly. If you already have a K3s cluster setup skip to the appropriate section below.

Install K3s

Install K3s as described in the documentation.

Install gVisor

@q3k
q3k / hashes.txt
Last active April 28, 2025 12:32
liblzma backdoor strings extracted from 5.6.1 (from a built-in trie)
0810 b' from '
0678 b' ssh2'
00d8 b'%.48s:%.48s():%d (pid=%ld)\x00'
0708 b'%s'
0108 b'/usr/sbin/sshd\x00'
0870 b'Accepted password for '
01a0 b'Accepted publickey for '
0c40 b'BN_bin2bn\x00'
06d0 b'BN_bn2bin\x00'
0958 b'BN_dup\x00'
@hirrolot
hirrolot / a-preface.md
Last active April 29, 2025 08:29
A complete implementation of the positive supercompiler from "A Roadmap to Metacomputation by Supercompilation" by Gluck & Sorensen

This is the predecessor of Mazeppa.

Supercompilation is a deep program transformation technique due to V. F. Turchin, a prominent computer scientist, cybernetician, physicist, and Soviet dissident. He described the concept as follows [^supercompiler-concept]:

A supercompiler is a program transformer of a certain type. The usual way of thinking about program transformation is in terms of some set of rules which preserve the functional meaning of the program, and a step-by-step application of these rules to the initial program. ... The concept of a supercompiler is a product of cybernetic thinking. A program is seen as a machine. To make sense of it, one must observe its operation. So a supercompiler does not transform the program by steps; it controls and observes (SUPERvises) the running of the machine that is represented by th

@o11c
o11c / every-vm-tutorial-you-ever-studied-is-wrong.md
Last active May 27, 2025 10:00
Every VM tutorial you ever studied is wrong (and other compiler/interpreter-related knowledge)

Note: this was originally several Reddit posts, chained and linked. But now that Reddit is dying I've finally moved them out. Sorry about the mess.


URL: https://www.reddit.com/r/ProgrammingLanguages/comments/up206c/stack_machines_for_compilers/i8ikupw/ Summary: stack-based vs register-based in general.

There are a wide variety of machines that can be described as "stack-based" or "register-based", but not all of them are practical. And there are a lot of other decisions that affect that practicality (do variables have names or only address/indexes? fixed-width or variable-width instructions? are you interpreting the bytecode (and if so, are you using machine stack frames?) or turning it into machine code? how many registers are there, and how many are special? how do you represent multiple types of variable? how many scopes are there(various kinds of global, local, member, ...)? how much effort/complexity can you afford to put into your machine? etc.)

  • a pure stack VM can only access the top elemen
@ShepherdSoasis
ShepherdSoasis / main.rs
Last active March 24, 2024 07:04
An example of serde's basic Serialize trait, implemented generically over any enumeration or structure.
use serde::Serialize;
struct Point {
x: i32,
y: i32,
}
fn main() {
let point = Point { x: 1, y: 2 };
;; curl -d 'id="1234"' -X POST 'http://localhost:65535/?name=otee'
(defn handler-that-needs-keyword-params
[{params :params}]
;; the following will return this response map:
;; {:body "Hello otee your ID is: 1234" ...}
(ring.util.response/response "Hello" (:name params) " your ID is: " (:id params)))
@dfr
dfr / buildah-install.md
Last active September 4, 2023 21:52
FreeBSD podman tech demo

This will pull in source code for podman, buildah and related modules, build everything and install to /usr/local. This all happens in a directory named 'build' which can be deleted to clean up or to force a clean build.

mkdir -p build
fetch https://gist.github.com/dfr/ac4dc043ee3780b690c5887a61f53494/raw/1e55da486792ffda61c9d6070d5d834888be9590/buildah-install.sh
chmod +x buildah-install.sh
(cd build && ../buildah-install.sh)

Make a container and run things inside it:

@leocosta037
leocosta037 / techday_upe_acesso_gcp.ipynb
Created September 30, 2021 17:25
TechDay_UPE_Acesso_GCP.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leocosta037
leocosta037 / techday_upe_acesso_azure.ipynb
Last active October 8, 2021 17:43
TechDay_UPE_Acesso_Azure.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.