Skip to content

Instantly share code, notes, and snippets.

#pragma once
#include <iostream>
#include <cstdint>
// 1/1/1900 -> Monday
uint64_t days_in_year(uint64_t y) {
bool div4 = (y & 0x3) == 0;
bool div16 = (y & 0xf) == 0;
# ------------------------------------------------------------------------
import sys
import N10X
import subprocess
import re
import os
import shutil
"""
black python formatter for 10x (10xeditor.com)
# ------------------------------------------------------------------------
import sys
import N10X
import subprocess
import re
import os
"""
autopep8 python formatter for 10x (10xeditor.com)
Version: 0.1.0
# ------------------------------------------------------------------------
import N10X
import subprocess
import json
import re
import xml.etree.ElementTree as ET
import os
import operator
import hashlib
import copy
# Format: <SettingName>: <Settingvalue>
# Setting name must appear at start of line and there must be whitespace after the colon.
# Multiple values can be comma separated or on subsequent lines.
#
# Valid settings for colour rules:
# REGEX() A regular expression. Colours entire match or first group.
# WORD() Matches a word (case sensitive)
# WORDI() Matches a word (case insensitive)
# TEXT() Match any text in the line (case sensitive)
# TEXTI() Match any text in the line (case insensitive)
@Andersama
Andersama / struct_of_arrays.ixx
Created August 26, 2023 00:25
Incomplete struct of arrays module file
module;
import <array>;
import <vector>;
import <tuple>;
import <bit>;
export module struct_of_arrays;
export {
/*
A barebones struct of arrays base structure
@Andersama
Andersama / wheathash.ixx
Created August 24, 2023 19:39
C++ wheathash (constexpr and modularized form)
module;
import <cstdint>;
import <cstring>;
export module wheathash;
/*
Wheathash takes (optimally) 32-bit inputs and produces a 64-bit hash as its result.
It is a slightly-edited version of Waterhash, which is an edited version of wyhash.
It is meant to use very similar code to Waterhash, which produces a 32-bit hash.
Original Author: Wang Yi <godspeed_china@yeah.net>
#pragma once
#include <string_view>
struct arguments {
int argc = {};
int contiguous_argc = {};
const char** argv = {};
size_t last_argument_size = {};
arguments(int arg_count, const char* arg_values[]) {
#pragma once
#include <string>
#include <filesystem>
//needs utf8-cpp!
void string_from(std::string& buf, const std::filesystem::path& path)
{
// buf.clear();
if constexpr (std::is_same_v<std::filesystem::path::string_type, std::string>) {
// buf.insert(buf.end(), path.native().data(), path.native().data() + path.native().size());
#pragma once
#include <cstdint>
namespace rng::utils {
struct debiased_u64 {
uint64_t bits = {};
uint32_t bit_count = {};
};
struct debiased_bool {