Skip to content

Instantly share code, notes, and snippets.

View silversquirl's full-sized avatar

Silver silversquirl

  • 05:24 (UTC +01:00)
View GitHub Profile
@silversquirl
silversquirl / binned_allocator.zig
Last active July 4, 2023 09:15
A fast, simple allocator for Zig
// BSD Zero Clause License
//
// Copyright (C) 2023 by silversquirl
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
@silversquirl
silversquirl / update-zig
Last active November 18, 2022 14:11
Simple script to update to latest zig master. Depends on curl, tar, xz and jq
#!/bin/sh -e
case "$(uname -s)" in
Linux) os=linux;;
Darwin) os=macos;;
FreeBSD) os=freebsd;;
*) echo 'Unsupported OS' >&2; exit 1;;
esac
curl -sSL 'https://ziglang.org/download/index.json' |
jq -r ".master| .version, (.\"$(uname -m)-$os\" | .tarball, .shasum)" | {
read -r version