Skip to content

Instantly share code, notes, and snippets.

@phrohdoh
phrohdoh / annotated_slp.c
Created April 28, 2020 14:07
[WIP] Age of Empires - Annotated SLP
// ---------------------------------- slp header -------------------------------
/* file version 0 0x00 */ 0x32, 0x2e, 0x30, 0x4e,
/* shape count 4 0x04 */ 0x00, 0x00, 0x00, 0x00,
/* comment 8 0x08 */ 0x74, 0x65, 0x73, 0x74,
/* 12 0x0C */ 0x20, 0x73, 0x6C, 0x70,
/* 16 0x10 */ 0x20, 0x63, 0x6F, 0x6D,
/* 20 0x14 */ 0x6D, 0x65, 0x6E, 0x74,
/* 24 0x18 */ 0x2C, 0x20, 0x62, 0x6C,
/* 28 0x1C */ 0x61, 0x68, 0x2E, 0x2E,
// ---------------------------------- shape 1 header ---------------------------
@phrohdoh
phrohdoh / empires-helper.jq
Last active June 6, 2025 12:53
Querying the Age of Empires 1997 database (`empires.dat`) with jq and a custom `empires2json` tool
# Requires: jq 1.5
##########
# Hello and welcome!
# Quick note: Comments in a jq program file (which this is!) begin with a '#'.
#
# The comments in this file assume you have ran `empires2json` on your AoE's `empires.dat` file
# and stored the result in a `empires-dat.json` file on disk.
#
# To make use of this file you will need `jq` 1.5 (or a later version) installed (see https://stedolan.github.io/jq/).
@phrohdoh
phrohdoh / slp.txt
Created July 13, 2016 00:25
Age of Empires 1997 SLP format
What follows is a description of the SLP format.
The actual author wishes to remain unknown, please email bryce@lanset.com with
your questions. However, I did not write this document.
Header
This structure totals 32 bytes and is packed to 1-byte boundaries.
typedef struct Shape_File_Header
{
@phrohdoh
phrohdoh / language.dll.txt
Created February 11, 2018 17:07
Age of Empires (1997) language.dll
{
101: "1",
102: "Copperplate Gothic Light",
103: "Comic Sans MS",
104: "Arial",
110: "Copperplate Gothic Light",
111: "12",
112: "B",
113: "Copperplate Gothic Light",
114: "21",
@phrohdoh
phrohdoh / snippets.clj
Last active May 26, 2021 11:39
assorted clojure snippets
;; -----------------------------------------------------------------------------
(require '[clojure.spec.alpha :as spec]
#_'[clojure.string :as str]
#_'[clojure.edn :as edn]
#_'[clojure.java.io :as io]
;; non-stdlib deps
'[clojure.spec.gen.alpha :as spec-gen] ;; org.clojure/test.check 1.1.0
'[clojure.data.json :as json] ;; org.clojure/data.json 2.3.1
#_'[datascript.core :as ds] ;; datascript 1.1.0
#_'[datascript.transit :as dsts]) ;; datascript-transit 0.3.0
@phrohdoh
phrohdoh / CSharpClass.cs
Created October 15, 2014 06:10
IronPython scripting for C#
using System;
namespace CSharpLib
{
public class CSharpClass
{
public int Add(int a, int b)
{
return a + b;
}
@phrohdoh
phrohdoh / _.md
Last active August 4, 2020 15:22
AutoPets Whisker mobile app snippets

fake activities for lib/litter/status/litter_status_tab.dart's _buildRecentActivitySection

    final fakeActivities = List<LitterRobotActivity>.from(
      LitterRobotUnitStatus.values.map(
        (unitStatus) => LitterRobotActivity(
          litterRobotId: 'x',
          unitStatus: unitStatus,
          timestamp: DateTime.now()
              .subtract(Duration(seconds: Random().nextInt(60 * 60 * 8))),
" vim-plug {{{
call plug#begin('~/.nvim/plugged')
Plug 'git@github.com:kien/ctrlp.vim.git'
Plug 'git@github.com:scrooloose/syntastic.git'
Plug 'git@github.com:itchyny/vim-cursorword.git'
Plug 'git@github.com:itchyny/lightline.vim.git'
Plug 'git@github.com:vim-scripts/Align.git'
Plug 'git@github.com:terryma/vim-multiple-cursors.git'
Plug 'git@github.com:mhinz/vim-startify.git'
@phrohdoh
phrohdoh / ynab-cli.py
Created April 30, 2019 17:20
A highly-specific Python 3 script operating on YNAB API JSON
#!/usr/bin/env python3
####
#
# Invoke like this:
#
# $ ./ynab.py ./data.json
#
# -or-
#
@phrohdoh
phrohdoh / ynab_v1.openapi_v3.yaml
Created April 30, 2019 15:22
YNAB API v1 OpenAPI v3 YAML
openapi: 3.0.0
info:
description: Our API uses a REST based design, leverages the JSON data format, and relies
upon HTTPS for transport. We respond with meaningful HTTP response codes and
if an error occurs, we include error details in the response body. API
Documentation is at https://api.youneedabudget.com
version: 1.0.0
title: YNAB API Endpoints
tags:
- name: User