Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kornman00's full-sized avatar

Sean kornman00

View GitHub Profile
@tterb
tterb / README-badges.md
Last active April 16, 2024 03:21
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

; Retro-Halo by Eddy Fries - edf@halcyon.com
processor 6502
include vcs.h
org $F000
; Compile switches
NTSC = 0
PAL = 1
PAL60 = 2
@twoscomplement
twoscomplement / gist:80c164be5cad7f51939e512f0142a5eb
Last active April 10, 2017 07:50
CRC tables, generated at compile time using C++11 constexpr, C++14 utility library, variadic template, initializer list
// CRC tables, generated at compile time using C++11 constexpr, C++14 utility library, variadic template, initializer list
// Compiled and tested using msvc 2015, gcc 6.2, and clang 3.9.0.
// clang requires -std=c++14 -ftemplate-depth=512
#include <stdint.h>
#include <utility>
template<typename T, T Poly>
struct CrcTable {
static constexpr T Generate(T v, int r = 8) {
@StagPoint
StagPoint / QuaternionCompression.cs
Last active April 1, 2024 16:54
C# - Use "smallest three" compression for transmitting Quaternion rotations in Unity's UNET networking, from 16 bytes to 7 bytes.
// Copyright (c) 2016 StagPoint Software
namespace StagPoint.Networking
{
using System;
using UnityEngine;
using UnityEngine.Networking;
/// <summary>
/// Provides some commonly-used functions for transferring compressed data over the network using
@nemotoo
nemotoo / .gitattributes
Last active April 19, 2024 15:35
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@bkaradzic
bkaradzic / orthodoxc++.md
Last active April 23, 2024 13:59
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

#pragma once
// This provides a library for stubbing and mocking C++ code as is. It works by requiring
// explicit hooks to be inserted into the code that is to be mocked. In a regular build,
// these hooks will do nothing. In a testing build, they will expand to calls into the
// framework here to allow the code being executed to be hijacked from outside.
//
// NOTE: Thread-safety! Arranging fakes must be done on a single thread. Using fakes can
// be done from multiple threads concurrently.
//
@paniq
paniq / minmaxabssign.txt
Last active January 30, 2023 14:31
useful min/max/abs/sign identities
max(-x,-y) = -min(x,y)
min(-x,-y) = -max(x,y)
abs(x) = abs(-x)
abs(x) = max(x,-x) = -min(x,-x)
abs(x*a) = if (a >= 0) abs(x)*a
(a < 0) -abs(x)*a
// basically any commutative operation
min(x,y) + max(x,y) = x + y
@dtao
dtao / EvilStringHelper.cs
Created August 16, 2012 17:01
Devious C# class that makes .NET strings mutable without requiring the /unsafe compiler switch
public static class EvilStringHelper
{
private static readonly Action<string, int, char> _setChar;
private static readonly Action<string, int> _setLength;
static EvilStringHelper()
{
if (Environment.Version.Major < 4)
{
MethodInfo setCharMethod = typeof(string).GetMethod(