Skip to content

Instantly share code, notes, and snippets.

View chatgpt-continue.js
setInterval(() => document.querySelector("button.btn:nth-child(2)").click(),4096)
View crucible.nix
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.haskell-nix.url = "github:input-output-hk/haskell.nix";
inputs.haskell-nix.inputs.nixpkgs-unstable.follows = "nixpkgs";
outputs = { self, haskell-nix, nixpkgs, }:
haskell-nix.inputs.flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = import nixpkgs {
inherit system;
View transmission-no-padding.js
for(let e of document.getElementsByClassName("inspector_torrent_file_list_entryodd")) {
if (e.children[2].innerText.includes("padding_file") && e.children[0].checked) {
e.children[0].click();
}
}
View shell.nix
{ pkgs ? import (builtins.getFlake "nixpkgs") {} }:
pkgs.mkShell {
nativeBuildInputs = [
(pkgs.python3.withPackages (ps: with ps; [stanza]))
];
}
View dlmalloc.md

The malloc implementation you provided is based on the dlmalloc (Doug Lea's Malloc) algorithm. This is a general-purpose allocator that is widely used due to its combination of speed and efficient use of memory.

The main concepts behind dlmalloc are:

  1. Chunk: The basic unit of memory allocation. Each chunk contains a header with size and status information, and a payload where user data is stored.

  2. Bin: A collection of free chunks of similar sizes. There are small bins (for small chunks) and tree bins (for large chunks).

  3. Segment: A large chunk of memory obtained from the system. Segments are divided into chunks which are then allocated to the user or stored in bins.

View x86_64-ghc.txt
export AR=/usr/lib/llvm-16/bin/llvm-ar
export CC=/usr/lib/llvm-16/bin/clang
export CC_FOR_BUILD=cc
export CXX=/usr/lib/llvm-16/bin/clang++
export LD=/usr/lib/llvm-16/bin/ld.lld
export NM=/usr/lib/llvm-16/bin/llvm-nm
export OBJCOPY=/usr/lib/llvm-16/bin/llvm-objcopy
export OBJDUMP=/usr/lib/llvm-16/bin/llvm-objdump
export RANLIB=/usr/lib/llvm-16/bin/llvm-ranlib
export SIZE=/usr/lib/llvm-16/bin/llvm-size
View afl++-fast.txt
export AFL_QUIET=1
./configure --enable-unregisterised --with-intree-gmp CC=/workspace/.local/bin/afl-clang-fast CXX=/workspace/.local/bin/afl-clang-fast++ CONF_CC_OPTS_STAGE2="-fbracket-depth=4096 -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types" CONF_CXX_OPTS_STAGE2="-fbracket-depth=4096 -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types" CONF_CC_OPTS_STAGE1="-fbracket-depth=4096 -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types" CONF_CXX_OPTS_STAGE1="-fbracket-depth=4096 -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types"
hadrian/build --flavour=perf+no_profiled_libs+no_dynamic_libs --docs=none -j
View ubsan.txt
./configure --enable-unregisterised --with-intree-gmp CC=/usr/lib/llvm-16/bin/clang CXX=/usr/lib/llvm-16/bin/clang++ CONF_CC_OPTS_STAGE2="-fsanitize=undefined -fbracket-depth=4096 -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types" CONF_CXX_OPTS_STAGE2="-fsanitize=undefined -fbracket-depth=4096 -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types" CONF_CC_OPTS_STAGE1="-fsanitize=undefined -fbracket-depth=4096 -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types" CONF_CXX_OPTS_STAGE1="-fsanitize=undefined -fbracket-depth=4096 -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types" CONF_GCC_LINKER_OPTS_STAGE2="-fsanitize=undefined" CONF_GCC_LINKER_OPTS_STAGE1="-fsanitize=undefined"
hadrian/build --flavour=quick-validate --docs=none -j test --summary-junit=junit.xml --summary=summary.txt --test-speed=normal
View renice.sh
# shellcheck shell=bash
renice --priority 19 --pid $$ &> /dev/null
View atomic-counter.diff
diff --git a/MutInt.cmm b/MutInt.cmm
index 0c3a209..1a77424 100644
--- a/MutInt.cmm
+++ b/MutInt.cmm
@@ -4,14 +4,13 @@
INFO_TABLE(stg_Counter, 0, 1, PRIM, "Counter", "Counter") ()
{
- return ();
+ foreign "C" barf("stg_Counter entered!", NULL) never returns;