Skip to content

Instantly share code, notes, and snippets.

View reedacartwright's full-sized avatar
💭
I may be slow to respond.

Reed A. Cartwright reedacartwright

💭
I may be slow to respond.
View GitHub Profile
@SupremeMortal
SupremeMortal / legacy_block_data_mappings.json
Last active March 19, 2021 22:50
Hardcoded legacy data map
{
"minecraft:stone": [
{"stone_type":"stone"},
{"stone_type":"granite"},
{"stone_type":"granite_smooth"},
{"stone_type":"diorite"},
{"stone_type":"diorite_smooth"},
{"stone_type":"andesite"},
{"stone_type":"andesite_smooth"},
{"stone_type":"stone"}
@imneme
imneme / splitmix.hpp
Created July 4, 2018 04:24
A C++ implementation of SplitMix
#ifndef SPLITMIX_HPP_INCLUDED
#define SPLITMIX_HPP_INCLUDED 1
/*
* A C++ implementation of SplitMix
* Original design by Guy L. Steele, Jr., Doug Lea and Christine H. Flood
* Described in _Fast splittable pseudorandom number generators_
* http://dx.doi.org/10.1145/2714064.2660195 and implemented in
* Java 8 as SplittableRandom
* Based on code from the original paper, with revisions based on changes
@imneme
imneme / xorshift.hpp
Last active February 15, 2023 17:47
A Family of Truncated XorShift* PRNGs
#ifndef XORSHIFT_HPP_INCLUDED
#define XORSHIFT_HPP_INCLUDED 1
/*
* A C++ implementation of a family of truncated XorShift* generators.
*
* The MIT License (MIT)
*
* Copyright (c) 2017-19 Melissa E. O'Neill
*
@imneme
imneme / randutils.hpp
Last active March 28, 2024 20:43
Addresses common issues with C++11 random number generation; makes good seeding easier, and makes using RNGs easy while retaining all the power.
/*
* Random-Number Utilities (randutil)
* Addresses common issues with C++11 random number generation.
* Makes good seeding easier, and makes using RNGs easy while retaining
* all the power.
*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Melissa E. O'Neill
*
@reedacartwright
reedacartwright / sync-ports
Last active April 15, 2021 04:07
A script to syncronize a local ports directory with the latest revision used to build FreeBSD packages.
#!/bin/sh
# Copyright (c) 2014-2015 Reed A. Cartwright <cartwright@asu.edu>
# Copyright (c) 2014-2015 Alberto Villa <avilla@FreeBSD.org>
# Copyright (c) 2015 Mike Clarke <jmc-freebsd2@milibyte.co.uk>
#
# This script determines the revision number used to build FreeBSD packages
# and syncs a local ports directory to match it.
#
# USAGE: sync-ports [name or abs_path]
#
@panzi
panzi / portable_endian.h
Last active April 18, 2024 20:59
This provides the endian conversion functions form endian.h on Windows, Linux, *BSD, Mac OS X, and QNX. You still need to use -std=gnu99 instead of -std=c99 for gcc. The functions might actually be macros. Functions: htobe16, htole16, be16toh, le16toh, htobe32, htole32, be32toh, le32toh, htobe64, htole64, be64toh, le64toh. License: I hereby put …
// "License": Public Domain
// I, Mathias Panzenböck, place this file hereby into the public domain. Use it at your own risk for whatever you like.
// In case there are jurisdictions that don't support putting things in the public domain you can also consider it to
// be "dual licensed" under the BSD, MIT and Apache licenses, if you want to. This code is trivial anyway. Consider it
// an example on how to get the endian conversion functions on different platforms.
#ifndef PORTABLE_ENDIAN_H__
#define PORTABLE_ENDIAN_H__
#if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) && !defined(__WINDOWS__)