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
#!/bin/bash | |
encodings="UTF-8 UTF-16LE UTF-16BE UTF-32LE UTF-32BE WINDOWS-1252 TCVN-5712 CP437 EBCDICATDE" | |
for enc in ${encodings,,}; do | |
echo -ne "20 text/plain charset=${enc}\r\n" > ${enc,,}.txt | |
echo -e "Serving content as ${enc}\n" | iconv -f "UTF-8" -t "${enc}" >> ${enc,,}.txt | |
iconv -f "UTF-8" -t "${enc}//TRANSLIT" ground-truth.txt >> ${enc,,}.txt | |
done |
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
/* Resource ID = 1 */ | |
TabLayout | |
{ | |
margins: 0; | |
DockLayout | |
{ | |
tab-title: "Menu"; | |
Button | |
{ | |
dock-site: bottom; |
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
#!/bin/bash | |
ROOT=$HOME/software | |
REPO_URL=https://ziglang.org/download/index.json | |
TMPDIR=/tmp/zig-update | |
REPO_ENTRY=x86_64-linux | |
function die() | |
{ |
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
/** | |
* Licence: MIT | |
* Author: Felix Queißner, 2020 | |
* | |
* Compile with: | |
* csc /out:Generator.cs /r:System.Drawing.dll Generator.cs | |
* | |
* Usage: | |
* Execute with a single file argument, this tool will generate a mask map for | |
* the Unity HDRP shader set. It assumes that the required files exist with |
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
const fixed_22_10 = arithmetic(i32) { | |
const Self = @This(); | |
fn add(lhs: Self, rhs: Self) Self { | |
return @as(Self, @value(lhs) + @value(rhs)); | |
} | |
fn mul(lhs: Self, rhs: Self) Self { | |
return @as(Self, (@as(i64, @value(lhs)) * @as(i64, @value(rhs))) / 1024); | |
} |
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
const std = @import("std"); | |
fn printSliceWithFilter(comptime T: type, values: []const T, context: var, filter: fn (T, @typeOf(context)) bool) void { | |
for (values) |val, i| { | |
if (!filter(val, context)) | |
continue; | |
std.debug.warn("[{}] = {}\n", i, val); | |
} | |
} |
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
const std = @import("std"); | |
// import the C headers here: | |
const c = @cImport({ | |
@cInclude("SDL.h"); | |
@cInclude("SDL_image.h"); | |
}); | |
/// game entry point which may return an error. | |
/// if the error is error.SdlError, SDL_GetError() will be called |
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
#!/bin/bash | |
# | |
# allows installing and/or updating your local | |
# zig installation. | |
# | |
# adjust INSTALLDIR, ZIG_OS, ZIG_TARGET to | |
# configure your installation. | |
# | |
# prerequisites: | |
# - jq (https://stedolan.github.io/jq/) |
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
const std = @import("std"); | |
/// stores some state for each coroutine | |
/// as well as a pointer to the frame to be resumed | |
const CoroutineState = struct { | |
pub const Self = @This(); | |
frame: anyframe = undefined, | |
quit: bool = false, | |
active: bool = false, |
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 <cstdint> | |
#include <cstddef> | |
#include <bitset> | |
// WARNING: Code untested! | |
/// @tparam LowAddress Inclusive lower address of allocation size | |
/// @tparam HighAddress Inclusive upper bound of allocation size | |
/// @tparam BlockSize Size of minimal allocation size | |
template<uintptr_t LowAddress, uintptr_t HighAddress, size_t BlockSize> |