Skip to content

Instantly share code, notes, and snippets.

View kebalicious's full-sized avatar
being a star

Kebal kebalicious

being a star
View GitHub Profile
@incredimike
incredimike / variousCountryListFormats.js
Last active July 22, 2024 04:39
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
//
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active July 22, 2024 12:48
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
@johnpolacek
johnpolacek / .gitconfig
Last active July 9, 2024 12:14
My current .gitconfig aliases
[alias]
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
st = status
aa = add -A .
@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 {
@danrovito
danrovito / countrydropdown.html
Last active July 24, 2024 12:55
HTML Country Select Dropdown List
<label for="country">Country</label><span style="color: red !important; display: inline; float: none;">*</span>
<select id="country" name="country" class="form-control">
<option value="Afghanistan">Afghanistan</option>
<option value="Åland Islands">Åland Islands</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
@steveirl
steveirl / list_quarters.php
Last active December 21, 2021 20:09
Get a list of (date) quarters between two given dates. Return array of objects with information about each quarter
<?php
// get month name from number
function month_name($month_number){
return date('F', mktime(0, 0, 0, $month_number, 10));
}
// get get last date of given month (of year)
function month_end_date($year, $month_number){
@cdinu
cdinu / getxypercent.js
Created September 25, 2015 13:42
Get XY coordinates as percentages
// 1. Load an image in a new tab
// 2. Open JS console. Leave it open
// 3. Paste this
var s = document.createElement('script');
s.setAttribute('src','https://code.jquery.com/jquery-2.1.4.min.js');
document.head.appendChild(s);
// 4. Then paste this
var oldx = 0, oldy = 0;
@nmfzone
nmfzone / domain.com
Created April 15, 2017 10:36
NginX SSL Config for Laravel/Lumen using Let's Encrypt
server {
listen 80;
listen [::]:80;
server_name domain.com;
# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
return 301 https://$host$request_uri;
}
@mfd
mfd / GTWalsheimPro.css
Last active May 3, 2024 16:52
GT Walsheim Pro
@font-face {
font-family: GT Walsheim Pro;
src: local("GT Walsheim Pro Regular"),local("GTWalsheimProRegular"),url(GTWalsheimProRegular.woff2) format("woff2"),url(GTWalsheimProRegular.woff) format("woff"),url(GTWalsheimProRegular.ttf) format("truetype");
font-weight: 400;
font-style: normal
}
@font-face {
font-family: GT Walsheim Pro;
src: local("GT Walsheim Pro Bold"),local("GTWalsheimProBold"),url(GTWalsheimProBold.woff2) format("woff2"),url(GTWalsheimProBold.woff) format("woff"),url(GTWalsheimProBold.ttf) format("truetype");
git log --all --grep="search text"