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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inspired by http://opensource.apple.com//source/xnu/xnu-1456.1.26/bsd/libkern/crc32.c | |
// You may use this program, or | |
// code or tables extracted from it, as desired without restriction. | |
namespace CRC32 | |
{ | |
public static class CRC32 | |
{ | |
static readonly uint[] crc32_tab = { | |
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"The common wisdom of "don't use conditionals in shaders" is one of my biggest frustrations with how shaders are taught. | |
step(y, x) _is_ a conditional! It compiles to identical code as: | |
float val = (x >= y ? 1.0 : 0.0) | |
or | |
float val = 0.0; | |
if (x >= y) val = 1.0;" | |
https://twitter.com/bgolus/status/1235254923819802626 | |
// Performing shader divisions without diving *rcp = approximation of 1/x | |
float myDividedVal = myValToDivide * rcp(myDivider); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef _WIN32 | |
// Use discrete GPU by default. | |
extern "C" { | |
// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf | |
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; | |
| |
// http://developer.amd.com/community/blog/2015/10/02/amd-enduro-system-for-developers/ | |
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; | |
} | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"image" | |
"image/color" | |
"image/gif" | |
"math" | |
"os" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- uses debug.sethook and a timer to break out of infinite loops in lua code within Hammerspoon | |
-- | |
-- Haven't had any problems with it or false positives, but YMMV -- standard disclaimers, etc. | |
-- | |
-- Updates 2015-12-21: | |
-- should play nicely with other hooks by storing info about it and chaining | |
-- you can force an "immediate" break by holding down CMD-CTRL-SHIFT-ALT-CAPSLOCK-FN all at once | |
-- you'll need to remove "and mods.fn" where noted below if your keyboard does not have this | |
-- modifier (non-laptops, I suspect) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# change the values below to match your system. | |
# target the BUILD_DIR to output from an nw.io build process. nwjs-shell-builder recommended! | |
# https://github.com/Gisto/nwjs-shell-builder | |
# BASE_DIR is the target directory for this script, where files will be gathered and packaged to | |
BUILD_DIR=”/var/www/deploy/TMP/osx-ia32/latest-git” | |
BASE_DIR=”/var/www/deploy/osx” |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Detect operating system in Makefile. | |
# Author: He Tao | |
# Date: 2015-05-30 | |
OSFLAG := | |
ifeq ($(OS),Windows_NT) | |
OSFLAG += -D WIN32 | |
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) | |
OSFLAG += -D AMD64 | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## curl https://gist.githubusercontent.com/ryanpcmcquen/687747c6de09693a6916/raw/torchlight-sdl-fix.sh | sh | |
# set this to your Torchlight directory | |
TORCHLIGHTDIR=/usr/local/games/Torchlight | |
## grab the SDL repo | |
hg clone http://hg.libsdl.org/SDL | |
## enter the directory | |
cd SDL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set this to your Torchlight directory | |
TORCHLIGHTDIR=$HOME/games/Torchlight | |
hg clone http://hg.libsdl.org/SDL | |
# check out the revision before the one that introduces the bug as advised here: http://forums.runicgames.com/viewtopic.php?f=24&t=33360&start=60#p474739 | |
hg up 4de584a3a027 --clean | |
# Fix X11 compilation issues with another changeset | |
hg export 6caad66a4966 > patch | |
hg import patch |