Skip to content

Instantly share code, notes, and snippets.

@will-hart
will-hart / README.md
Last active March 22, 2024 04:55
Stitch together tilemaps into a single image

Why?

This is a simple Python / PIL utility for taking a series of images in a tile map set and stitching them together into a single image. This is being used to convert these http://forums.bistudio.com/showthread.php?178671-Tiled-maps-Google-maps-compatible-(WIP) for www.anvilproject.com.

How?

  1. Drop the stitcher.py file into the root directory of your tile map set, where all the numbered folders are
  2. Edit two lines in the file, these are commented - one for the number of folders and one for the number of images in each folder
@will-hart
will-hart / Cargo.toml
Created August 25, 2023 14:24
PC to USB Device comms example
[package]
name = "pedalrs_gui"
version = "0.1.0"
authors = ["Will Hart <hart.wl@gmail.com>"]
edition = "2021"
rust-version = "1.56"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
@will-hart
will-hart / build.py
Last active January 26, 2023 12:35
Super Simple Static Site Generator (Python)
"""
Free to use under the MIT license
Builds a static site from a list of Markdown source files. The source
files should have the same directory structure as the desired output.
Files are rendered using Markdown2 and can declare metadata variables:
---
@will-hart
will-hart / test.rs
Created September 25, 2022 03:12
My helper for bevy system tests
use std::time::Duration;
use bevy::prelude::*;
use crate::core::time::SpectreTimePlugin;
pub struct TestWorld {
pub app: App,
}
@will-hart
will-hart / pedals.ino
Created February 8, 2022 06:33
Firmware for custom footpedals using "blue pill" STM32 boards
#include <USBComposite.h>
#define LEAN_LEFT_CHAR 'q'
#define LEAN_RIGHT_CHAR 'e'
#define LEAN_LEFT PA9
#define LEAN_RIGHT PA10
#define LED_PIN PC13
USBHID HID;
@will-hart
will-hart / LICENSE
Last active July 7, 2021 10:34
FFMPEG based video clipper
Public Domain
@will-hart
will-hart / plugin.py
Created July 1, 2013 09:36
A simple python plugin system using a custom metaclass
# a simple Python plugin loading system
# see http://stackoverflow.com/questions/14510286/plugin-architecture-plugin-manager-vs-inspecting-from-plugins-import
class PluginMount(type):
"""
A plugin mount point derived from:
http://martyalchin.com/2008/jan/10/simple-plugin-framework/
Acts as a metaclass which creates anything inheriting from Plugin
"""
@will-hart
will-hart / hexmap.py
Last active January 12, 2020 12:25
Hexmap generator inkscape extension, without inkscape (and using python 3)
#!/usr/bin/env python
# borrowed from https://raw.githubusercontent.com/lifelike/hexmapextension/master/hexmap.py
# which isn't working in inkscape
# import inkex
import sys
# from inkex import NSS
import math
import lxml
@will-hart
will-hart / list_files.py
Last active October 30, 2018 03:08
Get file information in a directory
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 30 13:43:22 2018
@author: Will Hart
"""
from datetime import datetime
from os import walk, path
@will-hart
will-hart / AbstractComponent.cs
Last active June 8, 2018 21:03
Sentry ECS - a simple public domain entity component system
public abstract class AbstractComponent : IComponent
{
[NonSerialized]
protected Entity _owner;
public AbstractComponent(Entity owner)
{
_owner = owner;
ID = Guid.NewGuid().ToString("n");
}