Skip to content

Instantly share code, notes, and snippets.

A.W. Stanley awstanley

  • Sydney, Australia
View GitHub Profile
awstanley / constexpr crc32 proof of concept.cpp
Last active Nov 28, 2018
CRC32 at compile time proof of concept. This can be expanded to virtually any other hash, and probably adapted to be cleaner in design (using the hash function as a template argument).
View constexpr crc32 proof of concept.cpp
#include <cstdint>
namespace {
/// IEEE CRC32 table.
static constexpr std::uint32_t crc32_table[] = {
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
awstanley / CMakeLists.txt
Last active Nov 29, 2017
CMake helper file. I've kept many copies of this semi-private for years, this one just contains a little more code to help people along. (Updated to include some missing defines, all of the ones in the current test project, so as to be sure they're all there.)
View CMakeLists.txt
# Copyright 2014-2017 A.W. 'aws' Stanley.
# Licensed under the Apache Licence, Version 2.0 [1] or
# MIT licence [2], at your option. This file may not be
# copied, modified, or distributed except according to
# those terms.
# [1] <>
# [2] <>
View factory setup
View testsga.go
package main
import (
_ ""
func main() {
awstanley / dl.go
Created Jul 17, 2016
Elusive Target Tracker (downloads current manifest; will throw an error an m will be nil if it's down). Obviously it needs work, but it was developed rapidly during ET #6 as a proof of concept.
View dl.go
package main
import (
func main() {
client := &http.Client{}
awstanley / hitman.txt
Created May 15, 2016
Hitman Benchmark (2016-05-15 11:34pm UTC)
View hitman.txt
System Info:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
CPU Cores: 8
CPU Speed: 3.40GHz
System Memory: 10.17GB / 15.90GB
GPU: AMD Radeon R9 200 / HD 7900 Series
GPU Memory: 2.98GB
Graphics Settings:
awstanley / dom4_pretender.cpp
Last active Mar 30, 2016
Dominions 4 Pretender Parser (proof of concept)
View dom4_pretender.cpp
#include <stdint.h>
#include <fstream>
#include <string>
#include <vector>
struct FileHeader
/* 0 */char header[6];
/* 6 */uint32_t serial;
View CMakeLists.txt
cmake_minimum_required(VERSION 3.4)
set(EXE_NAME "tilemapA5")
add_executable(${EXE_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp")
awstanley / StrippedBackExample.cs
Last active Aug 29, 2015
Space Engineers related code. Stripped back example of the lag causing code. (Updated to include DateTime code, typed manually into it from newer code; it should work, and I tested the error-free nature of it briefly in creative on a random block).
View StrippedBackExample.cs
// Configuration variables. Define this once, use it everywhere.
// (Save yourself the headache of rewriting it over and over again...)
// Two key points here:
// (1) All points should be out of standard usage (e.g. ☼ § « »);
// (2) Anything which MAY need to be typed (ever), should be available
// easily via ASCII or CharMap (for user access). Anything else
// (list delimiting) should be done sanely but copy+paste should
// be more than enough.
awstanley / Name_DetailedInfo.cs
Created Jan 6, 2015
Space Engineers script to get information from the block (CSV, but you need to parse it out)
View Name_DetailedInfo.cs
void Main()
for (int block = 0; block < GridTerminalSystem.Blocks.Count; block++)
if (GridTerminalSystem.Blocks[block] is IMyTerminalBlock)
IMyTerminalBlock Block = GridTerminalSystem.Blocks[block];
StringBuilder Str = new StringBuilder(); Str.Append(Block.BlockDefinition.ToString());
Str.Append("[" + Block.DetailedInfo + "] ");
You can’t perform that action at this time.