Skip to content

Instantly share code, notes, and snippets.

@MFDGaming
MFDGaming / 0.1.1j.txt
Created April 28, 2021 12:39
Minecraft: Pocket Edition 0.1.1j protocol
LoginPacket 0x86 (string)
MessagePacket 0x87 (string)
StartGamePacket 0x88 (long, int, int, float, float, float)
AddPlayerPacket 0x89 (guid, string, int, float, float, float)
RemoveEntityPacket 0x8a (int)
MovePlayerPacket 0x8b (int, float, float, float, float, float)
PlaceBlockPacket 0x8c (int, int, int, ubyte, ubyte, ubyte)
RemoveBlockPacket 0x8d (int, int, int, ubyte)
UpdateBlockPacket 0x8e (int, int, ubyte, ubyte, ubyte)
RequestChunkPacket 0x8f (int, int)
@probonopd
probonopd / Wayland.md
Last active November 19, 2024 11:01
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

The Wayland project seems to operate like they were starting a greenfield project, whereas at the same time they try to position Wayland as "the X11 successor", which would clearly require a lot of thought about not breaking, or at least providing a smooth upgrade path for, existing software.

In fact, it is merely an incompatible alternative, and not e

void call_gmon_start();
void frame_dummy();
void __do_global_ctors_aux();
void _init() {
call_gmon_start();
frame_dummy();
__do_global_ctors_aux();
@peterVG
peterVG / ipfs-on-raspberry-pi.md
Last active October 31, 2024 11:41
Put IPFS decentralized storage on your Raspberry Pi with USB storage

I put IPFS on a Raspberry Pi and so should you!

Total cost of joining the decentralized storage revolution with your own lo-fi node: $124 USD

raspberry-ipfs

@zserge
zserge / Add.java
Last active November 22, 2021 11:16
A tiny JVM to run a single method from a single class
public class Add {
public static int add(int a, int b) {
return a + b;
}
}
@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@cb372
cb372 / riscv.md
Last active September 24, 2024 03:09
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

@pepasflo
pepasflo / lexer.js
Last active July 30, 2023 09:03
A regex-based javascript lexer / scanner / tokenizer
#!/usr/bin/env node
var assert = require('assert');
// Each lexed token is a array of three integers:
// 1. the "token type": an index into the list of token patterns.
// 2. the index into the input string marking the start of this token.
// 3. the length of the token.
// The list of "token types" which our lexer understands:
@hoehrmann
hoehrmann / c11-lexer-grammar
Created June 22, 2018 22:10
C11 Lexer grammar
token = _
/ keyword
/ identifier
/ constant
/ string-literal
/ punctuator
preprocessing-token = _
/ header-name
/ identifier
@Tomcc
Tomcc / blockstate_protocol.md
Last active April 9, 2024 08:42
Block Changes in Beta 1.2.13

Block Storage & Network Protocol Changes

Paletted chunks & removing BlockIDs brings a few big changes to how blocks are represented. In Bedrock, Blocks used to be represented by their 8 bit ID and 4 bit data; this means that we can only represent 256 blocks and 16 variants for each block. As it happens we ran out of IDs in Update Aquatic, so we had to do something about it :)

After this change, we can represent infinite types of Blocks and infinite BlockStates, just like in Java. BlockStates are what is sent over the network as they are roughly equivalent to the old ID+data information, eg. they're all the information attached to a block.

BlockStates are serialized in two ways:

PersistentID: a PersistentID is a NBT tag containing the BlockState name and its variant number; for example