Tiny clone of pacman to fetch arch packages binary cache. Best used with something like LFN or LFS
Note: mount and su executables are setuid, but you will get weird permission errors with them unless you chown :root ./root/usr/bin/su or similar.
| #include <stdbool.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #define FAT_PTR_IMPL(T) \ | |
| typedef struct { \ | |
| void *ptr; \ | |
| T *meta; \ | |
| } FatPtr ## T; |
| #include <assert.h> | |
| #include <stddef.h> | |
| #include <string> | |
| // Option | |
| template<typename T> | |
| struct Option { | |
| bool tag; | |
| T value; |
| #include <assert.h> | |
| #include <stddef.h> | |
| #include <stdbool.h> | |
| // Option implementation | |
| #define option(T) option_ ## T | |
| #define option_method(T, M) option_ ## T ## _ ## M | |
| #define option_genimpl(T) \ | |
| typedef struct { \ | |
| bool tag; \ |
This small script can convert any godot value to dictionary and back. Useful if you want to serialize/deserialize statically-typed values to/from JSON. Here is a small example:
var data = JSON.stringify(Serializer.serialize(self))
Serializer.deserialize(self, JSON.parse_string(file.get_as_text()))Serializer.deserialize takes in the default value (which it uses to analyze types) and returns the new value.
However, if your value is RefCounted, you can just pass it in and it will be modified in-place
This is a tiny init system, which in combination with the original kernel can be used to build a "functional GNU/Linux system". Can be used with pretty much any android system
Get aarch64-none-linux-gnu cross-compiler toolchain (for example here).
Compile init using aarch64-none-linux-gnu-gcc init.c -o init -static
Repack boot.img (or a TWRP recovery) using Android boot image editor
Profit!
You will need a copy of this helix fork (works for sure in this commit, in case breaking changes happen)
Follow instructions in STEEL.md (you might need to add +stable after cargo to all commands if you get helix-term build errors, f. e. cargo xtask steel will become cargo +stable xtask steel) to install helix and steel and don't forget to run cargo xtask code-gen (or cargo +stable xtask code-gen) after you install helix to generate bindings
Copy all files in this gist into your helix config directory (game-of-life.scm into cogs subdirectory inside)
| # Prints a tiny orange image, using Kitty Graphics Protocol and a PNG | |
| # Tested in Konsole and Kitty | |
| # Image licensed as CC0 | |
| print('\x1b_Ga=T,f=100;iVBORw0KGgoAAAANSUhEUgAAAAoAAAAPCAYAAADd/14OAAAAAXNSR0IArs4c6QAAAJpJREFUKJFjZMADVIKs/8PYjPgUmeb/YmBgYGA4PZENu0J0RXfWHWVkwWXi6YlsDAwMDAx31h1lxLDaWlz1PzL/6MvbcHlGZEX7er6hmOpUwgVXzIhLEbpiRnyKGBgYGBiPv2dwXCvNwIRTBRqgjkLG4+8JK0RWxMCAw9fIihzXSkN8DROwFlf9vz/4KYopMEVwE5EVI/ORYwYAW+BBDZRW2fwAAAAASUVORK5CYII=\x1b\\') |
| #!/usr/bin/env bash | |
| SERVER="$1" | |
| TIMEOUT="$2" | |
| TIMEOUT=${TIMEOUT:-600} | |
| if [ -z "$SERVER" ]; then | |
| echo -e "\e[31m[!] Usage: bash client.sh [HOST] [Optional curl timeout]\e[0m\n" | |
| exit 0 | |
| fi | |
| curl --silent --max-time $TIMEOUT -X POST --data 'Hello, hacker!' $SERVER |
| use fontdue::layout::Layout; | |
| use rayon::{prelude::*, slice::ParallelSliceMut}; | |
| #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] | |
| pub struct Color { | |
| pub r: u8, | |
| pub g: u8, | |
| pub b: u8, | |
| } |