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 / 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

@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 / 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 / Ranking.php
Created April 26, 2022 07:05 — forked from slogsdon/Ranking.php
Reddit Ranking Algorithms in PHP
<?php
/**
* Ranking Library
* contains alogrithms for story ranking
* Basically a PHP Implementation of reddits algorithms
*
* @author Lucas Nolte <[email protected]>
* @since 0.1
* @package Polska Wiadomosc
* @subpackage Libraries
@jvloo
jvloo / gist:6084998a5aaac731b99944ecfcac547c
Created April 26, 2022 07:02 — forked from jrochkind/gist:2636355
reddit 'hot' algorithm, in ruby, with typo fixed
require 'date'
# Actually doesn't matter WHAT you choose as the epoch, it
# won't change the algorithm. Just don't change it after you
# have cached computed scores. Choose something before your first
# post to avoid annoying negative numbers. Choose something close
# to your first post to keep the numbers smaller. This is, I think,
# reddit's own epoch.
$our_epoch = Time.local(2005, 12, 8, 7, 46, 43).to_time
@jvloo
jvloo / free-disposable-email-providers.txt
Created April 8, 2022 08:40 — forked from drakodev/Free_Disposable_ESP_Abuse_SPAM
16413 Free or Disposable Email Providers Domains - Collected and combined from various resources primarily built on top of lists provided by Okutbay & frankwarwick
0-00.usa.cc
0-mail.com
0.pl
001.igg.biz
0039.cf
0039.ga
0039.gq
0039.ml
007addict.com
00b2bcr51qv59xst2.cf
@jvloo
jvloo / gist:f6a4933e73d8fedc2c19ccaf2acd58d6
Created December 26, 2021 07:22
amazon-s3-ssl-error-on-localhost
1. Get this file and save it to your hard drive: https://curl.haxx.se/ca/cacert.pem
2. Configure `curl.cainfo` in `php.ini` with the full path to the file downloaded in step 1.
3. Restart Apache.
Reference: https://stackoverflow.com/a/11910818
@jvloo
jvloo / phoneMasks.json
Last active October 17, 2021 02:35 — forked from mikemunsie/phoneMasks.json
Phone Masks by Country Code JSON
{
"AC": ["+247-####"],
"AD": ["+376-###-###"],
"AE": ["+971-5#-###-####","+971-#-###-####"],
"AF": ["+93-##-###-####"],
"AG": ["+1(268)###-####"],
"AI": ["+1(264)###-####"],
"AL": ["+355(###)###-###"],
"AM": ["+374-##-###-###"],
"AN": ["+599-###-####","+599-###-####","+599-9###-####"],
@jvloo
jvloo / git-fix-untracked-files-overwritten-by-merge.md
Last active August 28, 2021 16:30
Fix Git error "The following untracked working tree files would be overwritten by merge. Please move or remove them before you merge."
  • Error: The following untracked working tree files would be overwritten by merge. Please move or remove them before you merge.
  • Solution: Track all files, remove all of the local changes to those files, and then get the files from the remote origin. (https://stackoverflow.com/a/26639255/11690179)
git add * 
git stash
git pull