Skip to content

Instantly share code, notes, and snippets.

View nektro's full-sized avatar
🌻
if you know, you know

Meghan Denny nektro

🌻
if you know, you know
View GitHub Profile
const Archive = struct {
magic: [4]u8 = [_]u8{ 'q', 'o', 'z', 1 },
files_count: u32,
files: [*]File,
};
const File = struct {
flags: Flags,
data_length: u64,
const sites = {
"foo.localhost": 8001,
"bar.localhost": 8003,
"qux.localhost": 8004,
"sam.localhost": 8005,
};
// new version based on:
// https://stackoverflow.com/questions/20351637/how-to-create-a-simple-http-proxy-in-node-js
actualrandom() {
cat /dev/urandom | head -c $1 | xxd -ps | awk '{printf "0x" $0}' | xargs -0 printf "%d\n"
}
git-newbranchname() {
rand=$(actualrandom 2)
echo "nektro-patch-${rand}"
}
git-newbranch() {
git checkout -b $(git-newbranchname)
}
@nektro
nektro / quotes.md
Last active February 23, 2024 22:08

Any community that gets its laughs by pretending to be idiots will eventually be flooded by actual idiots who mistakenly believe that they're in good company.

Poe's law is an adage of Internet culture stating that, without a clear indicator of the author's intent, it is impossible to create a parody of extreme views such that it cannot be mistaken by some readers for a sincere expression of the views being parodied.

If you come in last place it doesn't mean you're bad, it just means everyone else is better than you.

Peace is not the absence of conflict, but the ability to deal with it in a peaceful way.

Having knowledge and not doing anything with it is just the same as having no knowledge.

pub const ErrorCode = enum(u16) {
/// The operation completed successfully.
ERROR_SUCCESS = 0x00000000,
/// Incorrect function.
ERROR_INVALID_FUNCTION = 0x00000001,
/// The system cannot find the file specified.
ERROR_FILE_NOT_FOUND = 0x00000002,
#!/usr/bin/env bash
set -e
arch=$(uname -m)
os=$(uname -s | tr '[:upper:]' '[:lower:]')
double="$arch-$os"
if [[ $1 == *"dev"* ]]; then
wget -q --show-progress https://ziglang.org/builds/zig-linux-x86_64-$1.tar.xz
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "test",
.root_source_file = .{ .path = "main.zig" },
.target = target,
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 925fd2d63..ff5005494 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -655,13 +655,13 @@ include_directories(
)
if(MSVC)
- set(EXE_CXX_FLAGS "/std:c++14")
+ set(EXE_CXX_FLAGS "/std:c++17")
@nektro
nektro / asm.s
Last active October 28, 2022 17:59
32bit x86 Linux hello world exploration
.text
.intel_syntax noprefix
.file "test"
.globl _start
.type _start,@function
_start:
push ebp
push ebx
push edi
push esi