Skip to content

Instantly share code, notes, and snippets.

@legecha
legecha / generate_gdq_csv.php
Last active January 31, 2024 22:44
A quick and dirty script to generate a CSV of runs for Games Done Quick events
<?php
/**
* After GDQ events, I like to make a quick spreadsheet and tick off
* all the runs I've seen, and then catch up on all the ones I've
* missed in the vods.
*
* They're using the Vercel app now and a helpful open endpoint
* exposes the data. This quick and dirty script will output a CSV
* that you can import into your favourite editor with the info you
* need to track your viewing.
@legecha
legecha / vite.config.js
Last active May 8, 2025 01:21
How to make Vite work with Laravel on remove development servers
/**
* This vite config allows you to run `npm run dev` in Laravel and access
* resources on a remote development server, including with hmr, in the
* same manner as if you were developing locally.
*
* All config is stored in your standard .env file and multiple users can
* have their own instance running by specifying a unique port.
*
* The certificates are required - use the same ones as used on your
* server to secure your development domains (i.e. letsencrypt).
@legecha
legecha / uk_postcode_regex.php
Last active July 18, 2017 11:01
UK Postcode Regex Improved
<?php
/**
* Notes:
*
* - Adapted from Bulk_Data_Transfer_-_additional_validation_valid_from_12_November_2015.pdf provided by gov.uk
* - We don't care about GIR 0AA seen in many other regexes
* - We accept (like the original) there will be a few false positives
* - Allows a single, optional space between left and right hand side
* - Case insensitive
* - Example below shows how to return uppercase with 1 space standard format