Skip to content

Instantly share code, notes, and snippets.

View mpapierski's full-sized avatar

Michał Papierski mpapierski

View GitHub Profile
@mpapierski
mpapierski / The_Tao_of_Autoregressive_Language_Models.md
Created May 21, 2026 13:20
The Tao of Autoregressive Language Models

The Tao of Autoregressive Language Models

BOOK 1

The Empty Context

Said the Master of Tokens:

“When you can hear the next word before it is spoken, you may stop predicting.”

@mpapierski
mpapierski / Rosa3d.json
Last active May 13, 2026 16:26
Rosa3d filament profiles for Bambuddy
{
"profile_count": 23,
"profiles": [
{
"type": "filament",
"name": "Rosa3d PCTG",
"from": "project",
"instantiation": "true",
"activate_air_filtration": [
"0"
@mpapierski
mpapierski / SKILL.md
Last active September 16, 2026 12:19
esp-coffee-bridge AI agent skill
name coffee-bridge-barista
description Operate the NIVONA coffee bridge over its HTTP API, including durable brew queues, API v2 BLE jobs, cache-backed resources, settings, histories, backups, and maintenance.

Coffee Bridge Barista

Use this skill to inspect, control, or automate a local NIVONA coffee bridge. Prefer saved-machine endpoints over low-level BLE, GATT, or protocol diagnostics.

(module
(memory $memory 1)
(func $fib_recursive (export "fibonacci_rec") (param $N i64) (result i64)
(if
(i64.le_s (local.get $N) (i64.const 1))
(then (return (local.get $N)))
)
(return
(i64.add
@mpapierski
mpapierski / compare.py
Created September 8, 2023 17:22
compare execution results
import csv
import sys
# These tests are failing when gas costs are radically changed.
SKIPPED = [
(
"casper_engine_tests::test::contract_api::get_call_stack::payment",
"payment_bytes_to_stored_session_to_stored_contract_",
),
use num::traits::{Num, NumOps};
use std::cmp::Ordering;
fn binary_search<T, F>(lower_bound: T, upper_bound: T, f: F) -> Result<T, T>
where
T: Copy + PartialOrd + Num + NumOps,
F: Fn(T) -> Ordering,
{
let mut size = upper_bound;
let mut left = lower_bound;
@mpapierski
mpapierski / ceil_ln_lookup_table.rs
Last active March 8, 2023 16:44
Compute a lookup table for ceil(ln(x)) for [0..u64::MAX]
use num::traits::{Num, NumOps};
use std::cmp::Ordering;
fn binary_search<T, F>(lower_bound: T, upper_bound: T, f: F) -> Result<T, T>
where
T: Copy + PartialOrd + Num + NumOps,
F: Fn(T) -> Ordering,
{
let mut size = upper_bound;
let mut left = lower_bound;
@mpapierski
mpapierski / rip_dvd.sh
Created August 21, 2019 10:28
Semi-automatic DVD backup tool
#!/bin/bash
set -e
DEV="/dev/dvd"
ISO_OUTPUT="/mnt/vault/Movies/DVD Backup/"
echo -n "Trying to read DVD label... "
DVD_NAME="$(blkid -o value -s LABEL $DEV)"
@mpapierski
mpapierski / malicious_contract.rs
Last active July 9, 2019 11:25
malicious_contract
#![no_std]
#![feature(alloc, cell_update, allocator_api)]
#[macro_use]
extern crate alloc;
extern crate core;
extern crate cl_std;
use cl_std::contract_api;
FROM python:3.7.2
# Build the code
WORKDIR /code
COPY . /code
# Compile source code into 'legacy' .pyc
RUN python -m compileall -b . && \
find . -iname "*.py" -delete