This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Detector for the crates.io supply-chain attack of 2026-08-20 (arrayref / proc-macro1). | |
| # | |
| # The payload is a build-time dependency: compiling a project that resolved to an affected | |
| # version is enough to be infected. This script is READ-ONLY -- it reports and exits with a | |
| # status code, it never removes or modifies anything. | |
| # | |
| # Exit codes: 0 clean, 1 suspect (manual review), 2 confirmed, 3 script/environment error. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source <(fzf --zsh) | |
| export FZF_DEFAULT_OPTS="--preview '[[ -f {} ]] && bat --style=numbers --color=always {} || echo {}'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef XXHASH_PROGRESSIVE_H | |
| #define XXHASH_PROGRESSIVE_H | |
| #include <stddef.h> | |
| #include <stdint.h> | |
| #define XXHP_PRIME32_1 UINT32_C(0x9e3779b1) | |
| #define XXHP_PRIME32_2 UINT32_C(0x85ebca77) | |
| #define XXHP_PRIME32_3 UINT32_C(0xc2b2ae3d) | |
| #define XXHP_PRIME32_4 UINT32_C(0x27d4eb2f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # AGENTS.md | |
| ## Core Principles | |
| - Surface tradeoffs explicitly. | |
| - Never hide uncertainty or confusion. | |
| - Be concrete. Use real examples and exact failure modes. | |
| - Verify behavior empirically whenever possible. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // color1 and color2 are R4G4B4 12bit RGB color values, alpha is 0-255 | |
| uint16_t blend_12bit( uint16_t color1, uint16_t color2, uint8_t alpha ) { | |
| uint64_t c1 = (uint64_t) color1; | |
| uint64_t c2 = (uint64_t) color2; | |
| uint64_t a = (uint64_t)( alpha >> 4 ); | |
| // bit magic to alpha blend R G B with single mul | |
| c1 = ( c1 | ( c1 << 12 ) ) & 0x0f0f0f; | |
| c2 = ( c2 | ( c2 << 12 ) ) & 0x0f0f0f; | |
| uint32_t o = ( ( ( ( c2 - c1 ) * a ) >> 4 ) + c1 ) & 0x0f0f0f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Copyright (c) 2022 Kris Jusiak (kris at jusiak dot net) | |
| // | |
| // Distributed under the Boost Software License, Version 1.0. | |
| // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
| // | |
| // | |
| // Usage | |
| // #![feature(specialization)] | |
| // #![allow(incomplete_features)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <optional> | |
| // unit/return | |
| static constexpr auto some = [](auto x) { return std::make_optional(x); }; | |
| // >>= bind | |
| template <typename T, typename F> | |
| static constexpr std::optional<T> operator>>=(std::optional<T> input, F&& func) { | |
| if (input) { | |
| return func(*input); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #![allow(unused)] | |
| use std::ops; | |
| /* | |
| This example serves no purpose, it implements peano arithmetic both as types and values. | |
| It's an excuse to overload the + operator. | |
| */ | |
| #[derive(Debug, Default, Clone, Copy)] | |
| struct Zero; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RAGELFILES:= $(wildcard *.rl) | |
| EXECUTABLES:= $(patsubst %.rl, %, $(RAGELFILES)) | |
| LDFLAGS+= -lstdc++ | |
| %.cc : %.rl | |
| ragel -G2 -C -o $@ $< | |
| all: $(EXECUTABLES) | |
| clean: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| java -jar $HOME/tools/smc_7_0_0/bin/Smc.jar "$@" |
NewerOlder