Skip to content

Instantly share code, notes, and snippets.

View joachimschmidt557's full-sized avatar

Joachim Schmidt joachimschmidt557

View GitHub Profile
@joachimschmidt557
joachimschmidt557 / flake.nix
Created March 28, 2022 16:23
abc-zz nix flake
{
outputs = { self, nixpkgs }: {
devShell."x86_64-linux" = nixpkgs.legacyPackages."x86_64-linux".mkShell {
buildInputs = with nixpkgs.legacyPackages."x86_64-linux"; [
cmake
python27
zlib
readline
libpng
];
{ pkgs ? import <nixpkgs> {} }:
pkgs.stdenv.mkDerivation {
pname = "urfkill";
version = "0.5.0";
src = pkgs.fetchFromGitHub {
owner = "lcp";
repo = "urfkill";
rev = "3cdade9e0b6394a756207dfb31a48fb200de2644";
This file has been truncated, but you can view the full file.
757/1098 behavior.floatop.test "behavior-x86_64-linux-gnu-Debug-c-multi @exp2"... OK
758/1098 behavior.floatop.test "behavior-x86_64-linux-gnu-Debug-c-multi @log"... OK
759/1098 behavior.floatop.test "behavior-x86_64-linux-gnu-Debug-c-multi @log2"... OK
760/1098 behavior.floatop.test "behavior-x86_64-linux-gnu-Debug-c-multi @log10"... OK
761/1098 behavior.floatop.test "behavior-x86_64-linux-gnu-Debug-c-multi @fabs"... OK
762/1098 behavior.floatop.test "behavior-x86_64-linux-gnu-Debug-c-multi @floor"... OK
763/1098 behavior.floatop.test "behavior-x86_64-linux-gnu-Debug-c-multi @ceil"... OK
764/1098 behavior.floatop.test "behavior-x86_64-linux-gnu-Debug-c-multi @trunc"... OK
765/1098 behavior.math.test "behavior-x86_64-linux-gnu-Debug-c-multi assignment operators"... OK
766/1098 behavior.math.test "behavior-x86_64-linux-gnu-Debug-c-multi three expr in a row"... OK
@joachimschmidt557
joachimschmidt557 / behavior_tests.sh
Created February 5, 2022 23:24
Automatically enable passing behavior tests
#!/usr/bin/env bash
IFS=":"
rg --json "if \(builtin.zig_backend == .stage2_arm\) return error.SkipZigTest;" test/behavior/ | jq -r 'select(.type == "match") | "\(.data.path.text):\(.data.line_number)"' | while read -r file line; do
cp "$file" "$file.bak"
sed -i "$line s/^/\/\//" "$file"
if "$PWD/zig-out/bin/zig" test -target arm-linux-gnu test/behavior.zig; then
rm "$file.bak"
@joachimschmidt557
joachimschmidt557 / make_release.sh
Created January 8, 2022 11:14
Cross-compile timew-sync-server with zig cc
#!/usr/bin/env bash
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CC=/home/joachim/src/timew-sync-server/zcc-x86_64-linux go build -o timew-sync-server-x86_64-linux
GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=/home/joachim/src/timew-sync-server/zcc-aarch64-linux go build -o timew-sync-server-aarch64-linux
@joachimschmidt557
joachimschmidt557 / derive.zig
Created April 14, 2021 22:09
Derive in Zig userland
const std = @import("std");
const testing = std.testing;
fn DeriveEql(comptime T: type) type {
return struct {
pub fn eql(self: T, other: T) bool {
return std.meta.eql(self, other);
}
};
}
@joachimschmidt557
joachimschmidt557 / goto.c
Created August 11, 2020 12:34
benchmarking computed gotos vs zig switch
int interp_goto(unsigned const char* code, int len) {
/* The indices of labels in the dispatch_table are the relevant opcodes*/
static void* dispatch_table[] = { &&do_halt, &&do_inc, &&do_dec};
#define DISPATCH() goto *dispatch_table[code[pc++]]
int pc = 0;
int val = 0;
DISPATCH();
This file has been truncated, but you can view the full file.
# callgrind format
version: 1
creator: callgrind-3.15.0
pid: 26374
cmd: zig build
part: 1
desc: I1 cache:
desc: D1 cache:
@joachimschmidt557
joachimschmidt557 / gist:f493771ffcb8333b5f4ec5d2e91b88da
Created January 21, 2018 03:50
Chocolatey Force Test results
Here the Force Test results (accessed by AppVeyor)
@joachimschmidt557
joachimschmidt557 / Update-AUPackages.md
Last active May 6, 2024 06:02
Update-AUPackages Report #powershell #chocolatey