Skip to content

Instantly share code, notes, and snippets.

Nathan Reed Reedbeta

Block or report user

Report or block Reedbeta

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Reedbeta
Reedbeta / interesting-libs.txt
Created May 28, 2019
Interesting libraries I might like to use in a project
View interesting-libs.txt
Interesting libraries I might like to use in a project...
Asset loading:
assetsys.h - virtual filesystem with ZIP backing, overlaying, etc https://github.com/mattiasgustavsson/libs/blob/master/docs/assetsys.md
cute_filewatch.h - file modification watching, for runtime reloading etc https://github.com/RandyGaul/cute_headers/blob/master/cute_filewatch.h
stb_image - https://github.com/nothings/stb/blob/master/stb_image.h
tinyexr - https://github.com/syoyo/tinyexr
tinygltf - https://github.com/syoyo/tinygltf
tinyobjloader - https://github.com/syoyo/tinyobjloader
@Reedbeta
Reedbeta / srgb.glsl
Created Aug 3, 2018
Conversion between sRGB and linear color encoding
View srgb.glsl
vec3 sRGBToLinear(vec3 rgb)
{
// See https://gamedev.stackexchange.com/questions/92015/optimized-linear-to-srgb-glsl
return mix(pow((rgb + 0.055) * (1.0 / 1.055), vec3(2.4)),
rgb * (1.0/12.92),
lessThanEqual(rgb, vec3(0.04045)));
}
vec3 LinearToSRGB(vec3 rgb)
{
@Reedbeta
Reedbeta / comptr.h
Created Feb 8, 2018
Auto-releasing wrapper for COM pointers
View comptr.h
// Auto-releasing wrapper for COM pointers
// Feel free to use this for whatever, I don't care
template <typename T>
struct comptr
{
T * p;
comptr(): p(nullptr) {}
comptr(T * other): p(other)
{ if (p) p->AddRef(); }
@Reedbeta
Reedbeta / letter-swapper.js
Created May 14, 2017
Letter swapper Greasemonkey script. Just for shits and giggles.
View letter-swapper.js
// ==UserScript==
// @name Letter Swapper
// @namespace reedbeta.com
// @version 1
// @grant none
// @include *
// @exclude https://*.google.com/*
// ==/UserScript==
var swaps =
@Reedbeta
Reedbeta / bash-and-cmd-in-context-menu.reg
Last active Mar 28, 2019
Windows registry edit to add Bash and Command Prompt items to Explorer context menu
View bash-and-cmd-in-context-menu.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\Bash]
@="Bash"
"Icon"=hex(2):25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,\
00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,41,00,\
70,00,70,00,73,00,5c,00,43,00,61,00,6e,00,6f,00,6e,00,69,00,63,00,61,00,6c,\
00,47,00,72,00,6f,00,75,00,70,00,4c,00,69,00,6d,00,69,00,74,00,65,00,64,00,\
2e,00,55,00,62,00,75,00,6e,00,74,00,75,00,6f,00,6e,00,57,00,69,00,6e,00,64,\
00,6f,00,77,00,73,00,5f,00,31,00,38,00,30,00,34,00,2e,00,32,00,30,00,31,00,\
@Reedbeta
Reedbeta / comptr.hpp
Created Jul 7, 2016
GPU PRNG & hash-function testbed
View comptr.hpp
// COM pointer - wraps a COM object and automatically calls AddRef() / Release() as necessary
#pragma once
template <typename T>
class comptr
{
public:
comptr ()
@Reedbeta
Reedbeta / cool-game-programming-blogs.opml
Last active Jun 16, 2019
List of cool blogs on game programming, graphics, theoretical physics, and other random stuff
View cool-game-programming-blogs.opml
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Graphics, Games, Programming, and Physics Blogs</title>
</head>
<body>
<outline text="Tech News" title="Tech News">
<outline type="rss" text="Ars Technica" title="Ars Technica" xmlUrl="http://feeds.arstechnica.com/arstechnica/index/" htmlUrl="https://arstechnica.com"/>
<outline type="rss" text="Polygon - Full" title="Polygon - Full" xmlUrl="http://www.polygon.com/rss/index.xml" htmlUrl="https://www.polygon.com/"/>
<outline type="rss" text="Road to VR" title="Road to VR" xmlUrl="http://www.roadtovr.com/feed" htmlUrl="https://www.roadtovr.com"/>
View langeval.md

Programming Language Evaluation

A list of simple tasks to perform when learning or evaluating a new language. Each of these should be able to be completed in a few hours, and will help to get the feel of the language and its standard libraries. A well-rounded set of evaluation tasks will help ensure all parts of the language are exercised. You might also write some tests to demonstrate implementation correctness.

Basics

  1. Hello world
  2. Read lines from a text file and output them in sorted order
  3. Read numbers from a text file and output the mean and standard deviation
  4. Given an amount of money and a list of coin denominations provided on the command line, output all the possible ways to make change
View hlsl.php
<?php
/*************************************************************************************
* hlsl.php
* -----
* Author: Nick Darnell (NickDarnell@gmail.com)
* Copyright: (c) 2010 Nick Darnell (NickDarnell@gmail.com)
* Release Version: 1.0
* Date Started: 6/30/2010
*
* HLSL language file for GeSHi.
View depth-comparison-error.py
# Simulator for depth comparison error (i.e. z-fighting)
# Nathan Reed, June 2015
# Written for Python 3.4; requires numpy
import math
import numpy as np
import optparse
# Parse command-line options
parser = optparse.OptionParser()
You can’t perform that action at this time.