Skip to content

Instantly share code, notes, and snippets.

View kebalicious's full-sized avatar
🪡
inventing something new

Kebal kebalicious

🪡
inventing something new
View GitHub Profile
@rahman541
rahman541 / ic_sample.php
Last active November 3, 2021 02:46
IC Number input validation on server side (PHP) using Regular Expression (Regex)
<?php
$ic = "123456-11-1111"; //default ic if not set
if(isset($_POST["ic"])){
$ic = $_POST["ic"];
}
$regex = '/^[0-9]{6}-[0-9]{2}-[0-9]{4}$/';
if (preg_match($regex, $ic)) {
echo 'Valid';
} else {
@johnpolacek
johnpolacek / .gitconfig
Last active March 8, 2025 22:15
My current .gitconfig aliases
[alias]
recent = "!git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' | head -n 10"
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
st = status
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active April 24, 2025 03:06
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@incredimike
incredimike / variousCountryListFormats.js
Last active April 12, 2025 05:30
List of Countries in various Javascript data structures: Alphabetical country lists & Country data objects.
// Lists of countries with ISO 3166 codes, presented in various formats.
// Last Updated: July 30, 2020
// If you're using PHP, I suggest checking out:
// https://github.com/thephpleague/iso3166
// or Laravel: https://github.com/squirephp/squire
//
// JS developers can check out:
// https://www.npmjs.com/package/iso3166-2-db
//