Skip to content

Instantly share code, notes, and snippets.

@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 <[email protected]>"]
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 / 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 / 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 / SinglePlayerFallback.cs
Created April 13, 2017 08:01
Single Player Fallback (Forge Networking)
namespace Goliath.Networking
{
#region Dependencies
using BeardedManStudios.Forge.Networking;
using BeardedManStudios.Forge.Networking.Unity;
// other usings
using UnityEngine;
#endregion
@will-hart
will-hart / castle.scad
Last active February 5, 2017 08:19
A simple castle wall written in OpenSCAD
// scale the wall up
wall_scale = 10;
// set wall proportions
wall_length = 1;
wall_thickness = 0.3;
wall_height = 0.8;
// crennelation properties
cren_duty_cycle = 0.5;
@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");
}
@will-hart
will-hart / events.cs
Last active September 7, 2016 11:32
Event driven version
///
/// PlayerManager.cs
///
using System;
public class PlayerManager : MonoBehaviour {
public event EventHandler PlayerDied;