Skip to content

Instantly share code, notes, and snippets.

View The-Running-Dev's full-sized avatar

Ben Richards The-Running-Dev

View GitHub Profile
@The-Running-Dev
The-Running-Dev / Design Patterns Guide.md
Last active October 25, 2025 00:23
Design Patterns Guide

If you already know some coding and are tired of the DSA/Leetcode treadmill, the next logical step is to shift from solving puzzles to building systems. That means learning design patterns, SOLID principles, and architectural thinking — the things that actually show up in production code.

Here’s a practical roadmap, not theory:

1. Core Design Patterns (the real backbone of OOP)
Focus on why they exist, not just how they work.

  • Creational: Singleton, Factory Method, Builder, Prototype → manage object creation (e.g. config loaders, factories for services).
  • Structural: Adapter, Facade, Decorator, Composite → wrap APIs, extend behavior, simplify interfaces.
  • Behavioral: Strategy, Observer, Command, Chain of Responsibility, State → modular logic, event systems, UI flows.
@The-Running-Dev
The-Running-Dev / Create Kavita Directory Structure
Last active October 1, 2025 04:16
Scans a directory of eBooks and creates a direcory and sub directories, with hard links to the actual eBooks.
<#
Save to: Create-Kavita-Structure.ps1
and run it with: .\Create-Kavita-Structure.ps1 -sourceDir 'DriveLetter:\PathToBooks' -kavitaDir 'DriveLetter:\PathToKavitaWatchedDir"
If sourceDir is not specified, assumes current directory (.)
If kavitaDir is not specified, assumes @Kavita under the current directory (.\@Kavita)
To test this without making any changes: Create-Kavita-Structure.ps1 -whatIf
#>
[CmdletBinding(SupportsShouldProcess = $true)]
Param(
@The-Running-Dev
The-Running-Dev / removeDependency.sh
Created November 22, 2024 14:56
How to Remove a Dependency in QNAP Package
# Resources
# Sample package: https://www.myqnap.org/product/radarr-qbase24/
# Create a simple package: https://cheng-yuan-hong.gitbook.io/qdk-qpkg-development-kit/creating-a-qpkg-package-using-qdk/creating-a-simple-qpkg-package
# QNAP SDK docs: https://edhongcy.gitbooks.io/qdk-qpkg-development-kit/content/
# You will need the QNAP SDK, https://github.com/qnap-dev/QDK
# Download the package and put it on your NAS
# SSH into the nas and go to the directory where the package is located
# Create the QNAP build evnironment
@The-Running-Dev
The-Running-Dev / gist:b5cdf43e24135cab9af7781990821378
Created June 27, 2025 13:26
Forwarding All LAN Traffic Through a Host Running VPN
Assuming:
VPN interface: nordlynx
Local interface: enp2s0
Local LAN subnet: 192.168.1.0/24
Host IP: 192.168.1.2
DNS server IP: 192.168.1.2:53
🔁 1. Enable IP Forwarding
```bash

This guide was created using Microsoft Windows 10 Pro

Version 10.0.17134 Build 17134

Installation

System Updates:

  • Settings -> Update & Security
  • Install all updates

Powershell Execution Policy:

  • launch Windows Powershell as administrator and execute:
something:
container_name: something
image: lscr.io/linuxserver/prowlarr:latest
....
healthcheck:
test: curl -sf http://localhost || exit 1
interval: 60s
timeout: 30s
retries: 5
start_period: 30s
#!/bin/bash
set -e
echo "Updating system..."
sudo apt update
sudo apt upgrade -y
echo "Installing prerequisite packages..."
sudo apt install -y \
@The-Running-Dev
The-Running-Dev / Winget-Update.ps1
Last active April 8, 2025 16:01
A PowerShell Script to Upgrade All Installed Software
param (
[switch] $verbose
)
# Function to log messages
function Log-Message {
param (
[string] $message,
[string] $type = 'INFO'
)
@The-Running-Dev
The-Running-Dev / .env.sample.doplarr
Created March 22, 2025 05:18
Docker Compose for *arr Services
# Exampe .env file for the Doplarr docker-compose.yml
BotToken=INSERT_YOUR_KEY_HERE
ConfigRootPath=/path/to/your/discord-bot/data
RequestsAPIKey=INSERT_YOUR_KEY_HERE
RequestsDefaultID=1
RequestsHost=requests
@The-Running-Dev
The-Running-Dev / encode.sh
Created April 1, 2019 15:18 — forked from lisamelton/encode.sh
This is the shell script I use to drive HandBrakeCLI to re-encode video files in a format suitable for playback on Apple TV, Roku 3, iOS, OS X, etc.
#!/bin/bash
# encode.sh
#
# Copyright (c) 2013 Don Melton
#
# This version published on June 7, 2013.
#
# Re-encode video files in a format suitable for playback on Apple TV, Roku 3,
# iOS, OS X, etc.