Skip to content

Instantly share code, notes, and snippets.

View wamphlett's full-sized avatar
🤔
Probably breaking something

Warren Amphlett wamphlett

🤔
Probably breaking something
View GitHub Profile
@wamphlett
wamphlett / relay_controller.ino
Created December 14, 2022 23:39
Ultracade Power Management
// store informatino about each pin mapping
typedef struct mapping_ {
int switchPin; // the switch pin
int relayPin; // the relay pin
int lastSwitchState; // the last recorded switch state
int currentRelayState; // the current state of the relay
unsigned long lastDebounceTime; // the last time the switch state changed
} mapping_t;
// switch pin to relay pin mapping
@wamphlett
wamphlett / example_hook.ahk
Created June 27, 2022 13:20
LEDBlinky Hooks Test
; set a specific animation
Run, C:\Ultracade\LEDBlinky\LEDBlinky.exe GameBoy.lwax
@wamphlett
wamphlett / LaunchDBFZ.ahk
Last active June 9, 2022 09:07
A basic AHK script to load Dragon Ball FigherZ from BigBox without Anti-Cheat causing an issue.
; Script to load Dragon Ball FighterZ.
;
; This game has multiple executables and first loads anti cheat before running the main executable.
; BigBox loses track of the game as the initial executable exits, this mean you get taken back to
; BigBox and the game continues to load in the backgroud.
; Start the game
Run, steam://rungameid/678950
; Wait for the anti cheat to exit.
@wamphlett
wamphlett / ipac_default_2p.cfg
Created May 25, 2022 22:05
RetroArch IPAC mapping template (default 2P)
## RetroArch keybind config template
## Can be copypasted into an existing config, appended with --apppendconfig, used as a core or game override, or used with the include directive in an existing config
# Keyboard input. Will recognize letters (a to z) and the following special keys (where kp_
# is for keypad keys):
#
# left, right, up, down, enter, kp_enter, tab, insert, del, end, home,
# rshift, shift, ctrl, alt, space, escape, add, subtract, kp_plus, kp_minus,
# f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12,
# num0, num1, num2, num3, num4, num5, num6, num7, num8, num9, pageup, pagedown,
@wamphlett
wamphlett / keyboard.cfg
Created May 25, 2022 21:59 — forked from Monroe88/keyboard.cfg
RetroArch keyboard mapping template
## RetroArch keybind config template
## Can be copypasted into an existing config, appended with --apppendconfig, used as a core or game override, or used with the include directive in an existing config
# Keyboard input. Will recognize letters (a to z) and the following special keys (where kp_
# is for keypad keys):
#
# left, right, up, down, enter, kp_enter, tab, insert, del, end, home,
# rshift, shift, ctrl, alt, space, escape, add, subtract, kp_plus, kp_minus,
# f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12,
# num0, num1, num2, num3, num4, num5, num6, num7, num8, num9, pageup, pagedown,
@wamphlett
wamphlett / resize.dart
Created June 12, 2019 00:09
A way to crop an image from an image stream in flutter to always have a 4:3 aspect ratio
// For FlutterNativeImage, see: https://github.com/btastic/flutter_native_image
// Takes the absolute file path
Future<String> resizeImage(String filePath) async {
ImageProperties properties = await FlutterNativeImage.getImageProperties(filePath);
int imageWidth;
int imageHeight;
switch (properties.orientation) {
case ImageOrientation.rotate90:
<?php
class TumblrStorage
{
public function get(): array
{
// code...
}
}
location / {
if ($http_origin ~* (https?://(localhost(:[0-9]+)?|([a-z0-9.]+)?example\.co\.uk)$) ) {
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
}
if ($request_method = 'OPTIONS') {
add_header 'Content-Type' 'text/plain charset=UTF-8' always;