Skip to content

Instantly share code, notes, and snippets.

View mrl22's full-sized avatar
πŸ’­
Always coding

Richard Leishman mrl22

πŸ’­
Always coding
View GitHub Profile
@mrl22
mrl22 / README.md
Last active April 15, 2026 11:18
How Webforward secures your platform

How Webforward Secures Platforms and Protects Your Data

This document outlines the security approach we implement when developing platforms. Security is built in from day one, not added later. Every platform is designed to be secure by default, enabling users to operate with confidence while we handle the complexity behind the scenes.


1. Passwordless "Magic Link" Authentication

We implement passwordless login to remove the risks associated with traditional passwords.

@mrl22
mrl22 / PASSWORDLESS_LOGIN_TASK.md
Last active April 10, 2026 13:23
AI Task: Laravel Passwordless Magic Link Authentication Implementation

AI Task: Laravel Passwordless Magic Link Authentication Implementation

This plan outlines the steps for an AI to implement a passwordless "magic link" authentication system in a Laravel application, replacing traditional password-based login.


Phase 1: Database & Model Setup

  1. Create LoginToken Migration:
    • Table name: login_tokens.
@mrl22
mrl22 / README.md
Last active April 10, 2026 12:57
How Webforward Implements Passwordless Login

How Webforward Implements Passwordless Login

Passwordless login removes the need for passwords entirely. Instead of remembering credentials, users log in using a secure, time-limited link sent to their email.

This improves both usability and security by removing one of the most common causes of breaches: weak or reused passwords.


How it works

@mrl22
mrl22 / README.md
Last active March 12, 2026 16:08
SEO Malware - cdn.aihack.top

SEO Malware

You likely found this page because the following obfuscated PHP code appeared somewhere inside your website after a compromise.

I encountered this exact payload inside a Laravel application where it had been written to storage/maintenance.php. Once present, it began generating large numbers of fake pages designed for search engines.

This repository/gist contains a cleaned and readable version of the code

@mrl22
mrl22 / app.js
Last active February 19, 2026 10:20
Livewire v3 and v4 - Redirect all internal links via wire:navigate (removes requirement to add wire:navigate to all links)
document.addEventListener('click', (event) => {
const link = event.target.closest('a');
if (!link) return;
// Modified clicks (new tab, etc)
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
// Already handled by Livewire
if (link.hasAttribute('wire:navigate')) return;
@mrl22
mrl22 / DbExportCommand.php
Created February 5, 2026 17:35
php artisan db:export - Very similar function to wp-cli db:export but for Laravel - Support MySQL and SQLite
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class DbExportCommand extends Command
{
/**
* The name and signature of the console command.
@mrl22
mrl22 / tailwindsize.html
Created January 29, 2026 17:27
Tailwindcss - Display what size you are in
<div class="fixed bottom-0 left-0 z-9999 p-2 text-xs font-mono bg-black text-white">
<div class="block sm:hidden">BASE</div>
<div class="hidden sm:block md:hidden">SM</div>
<div class="hidden md:block lg:hidden">MD</div>
<div class="hidden lg:block xl:hidden">LG</div>
<div class="hidden xl:block 2xl:hidden">XL</div>
<div class="hidden 2xl:block">2XL</div>
</div>
@mrl22
mrl22 / wireguard.sh
Created January 27, 2026 15:11
Start a wg-easy docker server
mkdir -p /root/docker/wireguard
docker run -d \
--name=wg-easy \
-e WG_HOST=<public_ip> \
-e PASSWORD=<password> \
-v /root/docker/wireguard:/etc/wireguard \
-p 51820:51820/udp \
-p 51821:51821/tcp \
--cap-add=NET_ADMIN \
--cap-add=SYS_MODULE \
@mrl22
mrl22 / README.md
Created January 13, 2026 16:34
s5cmd sync script for very large buckets with little to no ram

Low-Memory S3 Backup Script

Why I wrote this

I needed to back up a large S3-compatible bucket on a small VPS without running out of memory.

While tools like s5cmd sync work very well in many cases, they can struggle with extremely large buckets when memory is limited. I wanted something that:

  • stays within a predictable memory limit
  • makes its decisions on disk rather than in RAM
  • can be inspected and resumed at any stage
@mrl22
mrl22 / sshh.sh
Created December 10, 2025 11:34
RoyalTSX SSH Wrapper for Mac Terminal - PasswordAuthentication only.
#!/usr/bin/env bash
# sshh - Royal TSX launcher wrapper
set -euo pipefail
port=""
target=""
# Parse args
while [ "$#" -gt 0 ]; do