Skip to content

Instantly share code, notes, and snippets.

const std = @import("std");
const qoi = @import("qoi.zig");
const qoiv = @import("qoiv.zig");
pub fn main() !void {
const allocator = std.heap.page_allocator;
const args = try std.process.argsAlloc(allocator);
defer allocator.free(args);
const ppm_path = args[1];
const POWER = {
'+': 1,
'-': 1,
'*': 2,
'/': 2,
'^': 3,
};
function parse(input) {
let affix = 'prefix'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import std.mem;
import hex.dec;
import std.io;
using int = s32;
enum TextureFormat : u16 {
Unknown = 0,
Alpha8 = 1,
R8 = 2,
function indexOfMatch<T>(value: T, values: T[]) {
return values.indexOf(value)
}
interface Card {
power: [number, number, number, number],
team: number
}
enum UpdateKind {
advancement grant <targets/minecraft:entity[type: players, amount: multiple]> everything
advancement grant <targets/minecraft:entity[type: players, amount: multiple]> from <advancement/minecraft:resource_location>
advancement grant <targets/minecraft:entity[type: players, amount: multiple]> only <advancement/minecraft:resource_location> [<criterion/brigadier:string[type: greedy]>]
advancement grant <targets/minecraft:entity[type: players, amount: multiple]> through <advancement/minecraft:resource_location>
advancement grant <targets/minecraft:entity[type: players, amount: multiple]> until <advancement/minecraft:resource_location>
advancement revoke <targets/minecraft:entity[type: players, amount: multiple]> everything
advancement revoke <targets/minecraft:entity[type: players, amount: multiple]> from <advancement/minecraft:resource_location>
advancement revoke <targets/minecraft:entity[type: players, amount: multiple]> only <advancement/minecraft:resource_location> [<criterion/brigadier:string[type: greedy]>]
{
"header": {
"unk_version_1": 1,
"unk_version_2": 517
},
"items": [
{
"name": "Relay",
"guid": "DAA95265-FE3D-934B-84D4-FAAF5AF8F81F",
"unk1": "01000000-0000-0000-0000-0000EA070000",
@brecert
brecert / ubjson.hexpat
Created February 22, 2024 02:17
ubjson.hexpat
#pragma author bree
#pragma description UBJSON ( Universal Binary JSON) format
#pragma MIME application/ubjson
#pragma endian big
#include <std/io.pat>
#include <std/mem.pat>
#include <std/string.pat>
@brecert
brecert / pnp.pat
Last active September 6, 2024 19:57
#pragma endian big
import type.magic;
import std.array;
using f32 = float;
fn relative_to_parent(u128 offset) {
return addressof(parent) + offset;
};