Skip to content

Instantly share code, notes, and snippets.

View jvloo's full-sized avatar
💭
I may be slow to respond.

Xavier Loo jvloo

💭
I may be slow to respond.
View GitHub Profile
@jvloo
jvloo / Kernal.php
Created March 13, 2023 06:53 — forked from DanRibbens/Kernal.php
Laravel Recaptcha V3 with V2 Fallback
<?php namespace App\Http;
use App\Http\Middleware\VerifyRecaptcha;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's route middleware.
*
@jvloo
jvloo / Solution #1
Last active May 31, 2023 08:44
How can we find gaps in sequential numbering in MySQL?
SELECT (t1.id + 1) as gap_starts_at,
(SELECT MIN(t3.id) -1 FROM arrc_vouchers t3 WHERE t3.id > t1.id) as gap_ends_at
FROM arrc_vouchers t1
WHERE NOT EXISTS (SELECT t2.id FROM arrc_vouchers t2 WHERE t2.id = t1.id + 1)
HAVING gap_ends_at IS NOT NULL
gap_starts_at - first id in current gap
gap_ends_at - last id in current gap
Reference: https://stackoverflow.com/a/6057665/6875460
@jvloo
jvloo / README.markdown
Created September 1, 2023 08:56 — forked from marijn/README.markdown
List of nationalities in YAML, CSV and TXT format

List of nationalities

It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.

List of countries

I've also compiled a list of countries