Skip to content

Instantly share code, notes, and snippets.

View mbutler's full-sized avatar
🇦🇶
Exploring

Matthew Butler mbutler

🇦🇶
Exploring
View GitHub Profile
@mbutler
mbutler / phoenix-command.md
Last active May 18, 2024 15:37
Phoenix Command Small Arms Combat System - Leading Edge Games

1.0 Welcome to Phoenix Command

For those unfamiliar with role-playing games or wargames, Phoenix Command is an excellent introduction to the fascinating world of simulation gaming. Just as chess represents a strategic game of conquest and strategy, Phoenix Command details the action in modern small arms combat. Like chess, playing pieces moved on a playing surface resolve the action. But unlike chess, the playing pieces in Phoenix Command represent individual people, or characters, with combat resolved on a second-by-second basis. The outcome depends on each character's actions, skill, and strategy.

Any number of people can play Phoenix Command; it is ideally suited to two teams, with a referee to moderate the action.

1.1 Using the Game

Phoenix Command is a small arms combat system. It has been designed for use as a stand-alone game or as a combat system for any other game. Its self-contained rules may be used to accurately recreate combat scenarios from books, movies, current events, or history. All

https://watabou.itch.io/
https://donjon.bin.sh/
https://hexroll.app/
https://azgaar.github.io/Fantasy-Map-Generator/
@mbutler
mbutler / cthulhu.txt
Last active March 14, 2024 02:22
install log
9.04 2009-NOV-06
10.04 LTS 2012-FEB-03
kernel 3.5.2 2012-OCT-10
12.04.1 LTS on 2012-OCT-19
14.04.1 LTS on 2014-OCT-25
kernel 3.15.4-x86_64 2014-OCT-25
16.04.2 LTS on 2017-MAR-08
18.04.3 LTS on 2019-SEP-22
[DO NOT UPGRADE! Ubuntu 18.04 is last supported version for i386. Broken and restored from backup on 2024-MAR-13.]
@mbutler
mbutler / dicepools.py
Last active February 5, 2024 22:24
working with dice pools
import random
import collections
def roll_dice(dice):
"""Rolls mixed dice and returns the sum.
- dice: List of tuples (die_size, quantity) for each die type."""
total = 0
for die_size, quantity in dice:
for _ in range(quantity):
total += random.randint(1, die_size)
@mbutler
mbutler / word2vec
Created September 3, 2016 04:22
steps to use word2vec npm module
1. download pre-trained word vectors from http://nlp.stanford.edu/projects/glove/
2. Prepend appropriate number of words and length of vector to the file being used with sed command
sed -i '1s/^/400000 50\n\n/' glove.6B.50d.txt
3. w2v loadModel method
w2v.loadModel( './data/glove.6B.50d.txt', function(err, model){
console.log(model)
});
@mbutler
mbutler / gaslands
Last active January 21, 2024 22:00
Round structure for Gaslands: Refueled
### Gaslands Round Structure:
#### Gear Phases:
- Each round is divided into **6 Gear Phases** (from 1 to 6).
- A vehicle qualifies for activation in a Gear Phase if its **current Gear is equal to or higher** than the Gear Phase number and it has not yet activated in that Gear Phase.
- Starting with the player in **Pole Position**, players take turns activating a single qualifying vehicle. The **Pole Position** marker is passed clockwise to the next player at the end of each Gear Phase.
#### Vehicle Activation:
1. **Movement Step**:
- **Select a movement template**: Choose a permitted template based on the vehicle's current Gear.
@mbutler
mbutler / fsk.py
Created January 20, 2024 19:36
Simple Frequency Shift Keying implementation for digital modulation
import numpy as np
import wave
import struct
from scipy.signal import butter, lfilter
# Function to convert text to FSK and save as a WAV file
def text_to_fsk_wave(text, filename):
bit_rate = 1200
freq_low = 1200
freq_high = 2400
@mbutler
mbutler / painting-prompt.md
Created January 20, 2024 18:03
Prompt DALL-E for a style of painting that I like

"Create a painting using traditional oil painting techniques on canvas. Begin with a toned ground to establish a neutral mid-tone. Sketch out the composition with an underpainting, focusing on correct values. Build up the painting with multiple layers of both opaque and translucent oil paints, employing a variety of brushwork: fine, detailed strokes for texture and broader gestures for the background. Use glazing techniques to enrich colors, starting with lighter hues and gradually adding darker shades to create depth. Maintain a controlled palette of earth tones with strategic touches of high chroma colors for visual accents. Pay attention to edge quality, keeping them sharp in the foreground and softer in the background. Finish with a varnish to enhance the vibrancy and depth of colors."

@mbutler
mbutler / comic-prompt.md
Last active January 15, 2024 01:12
dall-e prompt template

A fully colored hand-drawn comic illustration in the style of 1960s pulp adventure magazines, without any textual elements. The coloring should use muted washes, with a palette that is vibrant yet subdued, typical of 60s comic illustrations, capturing the textured, ink-heavy look with dramatic shading and expressive line work.

The scene is [describe the specific scene or setting]

In the foreground, [describe the main character or characters, including appearance and actions].

[Include any additional background elements or details].

=====================

@mbutler
mbutler / base64-steganography.js
Last active January 14, 2024 20:22
steganography in base64 images
const PNG = require('pngjs').PNG
const fs = require('fs')
// Function to embed text into a base64 encoded PNG
function embedTextInBase64PNG(base64Image, text) {
let data = Buffer.from(base64Image, 'base64')
let png = PNG.sync.read(data)
let textBinary = (text + '\0').split('').map(char => char.charCodeAt(0).toString(2).padStart(8, '0')).join('')
let dataIndex = 0