Skip to content

Instantly share code, notes, and snippets.

View nimaid's full-sized avatar

Ella Jameson nimaid

  • Tucson, AZ
View GitHub Profile
@nimaid
nimaid / SwitchAutoBackup.bat
Last active May 2, 2024 13:16
WinSCP + Batch script to automatically backup various Nintendo Switch homebrew folders over FTP
@echo off
for %%x in (
"C:\Games\Switch\SwitchAutoBackup\JKSV\"
"C:\Games\Switch\SwitchAutoBackup\Album"
"C:\Games\Switch\SwitchAutoBackup\forwarders"
"C:\Games\Switch\SwitchAutoBackup\retroarch\roms"
"C:\Games\Switch\SwitchAutoBackup\retroarch\savefiles"
"C:\Games\Switch\SwitchAutoBackup\retroarch\system"
"C:\Games\Switch\SwitchAutoBackup\openrct2\home"
@nimaid
nimaid / SwitchMap.ahk
Last active April 22, 2024 01:15
A simple AutoHotKey (v1) script to map controller buttons unused by Switch emulators to external hotkeys.
DisplayHelpMsg()
Joy14:: ; Share button = F8 (Ryujinx screenshot)
TrayTip Screenshot Captured, A screenshot has been saved to the Ryujinx screenshots folder.
Send {F8 down}
KeyWait Joy2
Send {F8 up}
return
Joy13:: ; Home button = Alt + 3 (Shadowplay)
@nimaid
nimaid / blackout.ahk
Last active April 19, 2024 22:26
AutoHotKey (v1) scipt to add useful tools for blacking out the screen and hiding the cursor/border/taskbar
SystemCursor("Init")
GuiShown = false
DisplayHelpMsg()
#N:: ; Toggle blackout window = Win + N
WinGetTitle, title, A
If GuiShown = false
{
Gui, Color, black
@nimaid
nimaid / timestring.py
Last active December 24, 2023 16:05
A module to provide tools to format time-based objects into strings.
"""Provides tools to format time-based objects into strings."""
import datetime
from typing import Union
def split_seconds(seconds_in: Union[int, float]) -> dict[str, Union[int, float]]:
"""Split seconds into days, hours, minutes, and seconds, and return a dictionary with those values.
:param int seconds_in: The total number of seconds to split up.
:return: A dictionary with the split weeks ['w'], days ['d'], hours ['h'], minutes ['m'], and seconds ['s'].
@nimaid
nimaid / validate.py
Last active December 26, 2023 04:39
A very lightweight data validation class.
from dataclasses import dataclass
from typing import Any
class ValidationError(ValueError):
def __init__(self, message: str = None):
self.message = message
super().__init__(message)
@dataclass
class Validate:
@nimaid
nimaid / eta.py
Last active December 22, 2023 17:45
General purpose python classes for computing ETAs and formatting time strings.
import datetime
class TimeString:
@staticmethod
def split_seconds(seconds_in):
days, remainder = divmod(seconds_in, (60 ** 2) * 24)
hours, remainder = divmod(remainder, 60 ** 2)
minutes, seconds = divmod(remainder, 60)
return {
@nimaid
nimaid / maze.lua
Created August 23, 2023 06:18
A maze generator for ComputerCraft (Direct Version)
-- pastebin get R8SRcS2S maze.lua
-- A recursive backtracker maze generator for my Create mechanical maze
-- All function parameters are 0-indexed, Because I hate LUA.
-- To install the slave PC software:
--[[
pastebin get 5fGx23UZ rx.lua
edit rx.lua
pastebin get GWSF49zj startup.lua
@nimaid
nimaid / d_latch.rlc
Created August 22, 2023 01:42
Minecraft "Redstone Pen" RLC Code - Transparent D Latch
# A simple transparent D latch
#
# U is enable
# R is data in
# Y is data out
Y=IF(U, R, Y)
@nimaid
nimaid / shift_reg.rlc
Created August 22, 2023 01:41
Minecraft "Redstone Pen" RLC Code - Shift Register
# A simple shift register
#
# U is clock
# D is data in
# R, B, Y, G is out (in order)
G=IF(U.RE, Y, G)
Y=IF(U.RE, B, Y)
B=IF(U.RE, R, B)
R=IF(U.RE, D, R)
@nimaid
nimaid / maze_sr.lua
Last active August 23, 2023 00:26
A maze generator for ComputerCraft (Shift Register Version)
-- pastebin get wz9tPFbS maze.lua
-- A recursive backtracker maze generator for my shift regiser based mechanical maze
-- All function parameters are 0-indexed, Because I hate LUA.
-- Shift register connections
local clk = "left"
local data = "back"
local latch = "right"