Skip to content

Instantly share code, notes, and snippets.

@chrispsn
chrispsn / we-need-to-talk-about-group.md
Last active February 9, 2024 06:33
We need to talk about group.

We need to talk about group.

I'm sorry to tell you, but group is gone.

If you check out the latest k.d on shakti.com as at 28 March 2023, you'll see that 'unary' = is now 'freq' (frequency).

Group had a long life: it's been around since at least k2, or 1996.

So why did group go? And what should we use instead?

@kennytv
kennytv / readme.md
Last active September 7, 2024 18:09
Signed Chat and Chat Types

Signed chat

This gist intends on clearing up some of the misinformation surrounding signed chat/the reporting feature Mojang has added to Minecraft 1.19.1. Here you can find both technical information as well as a general explanation of how these work.

Profile keys

After joining a server, clients now send a profile key used for verifying a message's authenticity. This key and thus the whole signing process is optional, but by default, servers enforce secure profiles for clients to send chat messages. Whenever the player sends a chat message and has a key associated, the message will be signed using their own private key, which the server then verifies using the public key sent after join. Assuming signature, timestamp, and message contents line up, the message goes through.

On the other end, clients can also require all broadcasted player messages to be signed, disregarding the ones without sender verified signatures.

Message signatures

@swatson555
swatson555 / compile.ss
Created June 22, 2022 13:13
nanopass compiler for r0 language
#!/usr/bin/env scheme --script
(import (nanopass))
(define unique-var
(let ()
(define count 0)
(lambda (name)
(let ([c count])
(set! count (+ count 1))

Quick start

Tauri is shipped with state management function/feature by default.

Basic usage is quite simple: a variable of State type can be accessed on the tauri commands which you have defined; in other words, "with tauri commands, they'll magically inject state for you," so that once a variable is managed you can inject them directly as additional input when defining the command.

Example Implementation

@phase
phase / 1.16.4-packet-rip.md
Last active November 13, 2024 00:24
1.16.4 packet class parsing result (very wip)

net/minecraft/network/protocol/game/ClientboundAddEntityPacket

Field Name Field Type
id I
uuid Ljava/util/UUID;
x D
y D
z D
xa I
@LambdAurora
LambdAurora / optifine_alternatives_fabric.md
Last active October 1, 2024 15:12
Recommended OptiFine alternatives on Fabric

The list is moving out!

If you share this list, please use this link instead: https://lambdaurora.dev/optifine_alternatives

It may still be only a redirection link, but it will have a better web display of the list soon. And the list being on GitHub/GitHub pages improves load times.

The gist version of this list will stop being updated.

Why?

@Drovolon
Drovolon / 1.14.x-chunk-loading-final.md
Created August 11, 2019 14:36
An overview of chunk loading mechanics in Minecraft 1.14, tested empirically in 1.14.4.

1.14.x Chunk Loading

Chunk loading operates differently in 1.14 than in previous Minecraft versions. This document is intended to be an overview of the 1.14 system.

In 1.14, chunk loading starts with tickets. A ticket is:

  • a ticket type
  • a load level
  • optionally, a time-to-live

Communicating type theory and formal systems

Doing a better job of communicating type theory and formal systems

Problems to solve

  • languages should have better specifications
  • our current notation limits our reach
  • puts up barriers between researchers and potential implementers
  • hard to gain an intuition of complicated formal systems from static descriptions

Litecoin Cash (LCC) was 51% attacked

Preamble

Litecoin Cash is a Bitcoin Core clone which uses a hybrid Proof-of-Work/Proof-of-Stake consensus algorithm in an attempt to aleviate 51% attacks on its network. LCC's PoW algorithm is SHA256 but its network hashrate is many orders of magnitude smaller than Bitcoin's, making it highly vulnerable to 51% attacks, as was demonstrated last year. The LCC whitepaper describes a system they call "Hive Mining", which is effectively a PoS lottery in which users can purchase "bees" (lottery tickets) that have the potential to be eligible to propose a PoS block for each new PoW block. In the paper, the authors claim this scheme provides "protection" from 51% attacks by interlacing PoW and PoS blocks, and giving PoS blocks more relative weight than PoW blocks in the chain-work calculation for selecting the most-work block.

The Attac

@nadavrot
nadavrot / Matrix.md
Last active November 15, 2024 16:00
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of