Skip to content

Instantly share code, notes, and snippets.

View awstanley's full-sized avatar

A.W. Stanley awstanley

  • Sydney, Australia
View GitHub Profile
@awstanley
awstanley / CMakeLists.txt
Created March 24, 2016 21:42
Tilemap example using the A5 builder ( https://github.com/awstanley/a5builder )
project("tilemapA5")
cmake_minimum_required(VERSION 3.4)
set(EXE_NAME "tilemapA5")
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include("D:\\a5\\builder\\AllegroDependencies.cmake")
add_executable(${EXE_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp")
LINK_ALLEGRO(${EXE_NAME})
install(TARGETS ${EXE_NAME} RUNTIME DESTINATION "${CMAKE_BINARY_DIR}/build")
@awstanley
awstanley / dom4_pretender.cpp
Last active March 30, 2016 11:30
Dominions 4 Pretender Parser (proof of concept)
#include <stdint.h>
#include <fstream>
#include <string>
#include <vector>
struct FileHeader
{
/* 0 */char header[6];
/* 6 */uint32_t serial;
@awstanley
awstanley / hitman.txt
Created May 15, 2016 23:16
Hitman Benchmark (2016-05-15 11:34pm UTC)
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
awstanley / dl.go
Created July 17, 2016 09:26
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.
package main
import (
"github.com/awstanley/Hitman/Go/misc/elusivetracker"
"net/http"
)
func main() {
client := &http.Client{}
package main
import (
_ "github.com/awstanley/go.sga"
"image"
"image/png"
"os"
)
func main() {
0eNqlnetuXEeuhd9Fv62g7pe8ysHgwHY0GQGOZEjtgwkCv/uRM2q7J6ndWuurX0HieBWbxeKuIhfJP24+fPpy9/np/uF08/MfN/cfHx+eb37+nz9unu9/fXj/6dt/O/3++e7m55v7091vN+9uHt7/9u3f7v79+enu+fn29PT+4fnz49Pp9sPdp9PN13c39w+/3P375uf49d3bIJ/uPp6e7j/e/vPL08P7j3cXfz19/ce7m7uH0/3p/u4/Av35L7//78OX3z7cPb3gvyXKu5vPj88vf/3x4dv6L5C3ub67+f3ln7G/rPPL/dPL4n/+afkm6l/gE4BvOnz24VPU4QuATzp89eG7jt589KGjdxvdEH3Y4IbNTBvcMZkYfPhgwPvn1Tmu0T+vuRjw4LyW/Irf/hs/rfDBgS3FwK8b+PXrCrFtaKQKEneAHw2NDICfDPy5Ib+gnxQ25Ffwyfd16vpJ4ANbgoGfN+RX9FM25FfwwYnNw9APOL+5r/GX96e+IX8V8P9+fp8/f7o/nV7+cHU1+6ka2HPjbinoJoeNy6WCHy3dFEc3OW3cXBXZd27Givw7V2NF/rqBr8jf+N1bge8cXtHO4Hd7BX5yeEE5JeC3g4IeMbqgmpLw00RBzxhd0UzhLx8FvnJ4RTeNP6wU+M7hFeUM/m5TpJ8cXpC+Bv4sFKSvkcMr0qeNV1tZvdpq3kDMS8Sy8Q5cy1g3ENcy7tx1s7BPO3fd/PZdvXp33f79PlcE2efGXVTQTQuW7NWRvdF7riI3CQAXQ/ade66Cv3PPVfB37rmK/puztylYe7txyVVUs3HJVeAnl15QTg9cegXeOrPV2dae8AVaUHvnV1wFvWB0RTPVUHq3dN743VlRy8blVoEfHF5RzjTUnqKj9xH4vVlQzNjI1ijSb2RrFPjM4RXl7CRr0uqCOnbSM3GJuJOeWcvYNxDXMo6Na3kS9mnCEHEUcrE7IVxB9rlDb1DkTxv4ivwk/ZLX+Ksn0Swb13MFn6RfooFPnqTJwP9xWp8
@awstanley
awstanley / constexpr crc32 proof of concept.cpp
Last active November 28, 2018 06:54
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).
#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
awstanley / CMakeLists.txt
Last active August 11, 2019 17:23
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.)
# 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] <http://www.apache.org/licenses/LICENSE-2.0>
# [2] <http://opensource.org/licenses/MIT>
@awstanley
awstanley / bits.py
Last active November 13, 2019 05:40
DJA0230TLS Dump Status
# Goes in the same directory as the output;
# create `rendered` (folder) and put index.html in it
from json import JSONEncoder, JSONDecoder
JE = JSONEncoder()
JD = JSONDecoder()
store = []
@awstanley
awstanley / svg_inject_test.html
Created September 26, 2020 12:29
Demonstration of SVG creation in JavaScript.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SVG Inject Test</title>
</head>
<body>
<script>
// Simple pathPath which is just a box with a point injected and raised. Nothing fancy!
let path = "M 3.9115288,12.97346 15.805024,2.3901266 27.698518,12.97346 V 33.152308 H 3.9115288 Z";