Skip to content

Instantly share code, notes, and snippets.

View keithmifsud's full-sized avatar

Keith Mifsud keithmifsud

View GitHub Profile
@forkbombe
forkbombe / post-type.php
Created June 16, 2016 10:04
An example of how to create a WordPress Custom Post type using an Object Oriented approach
<?php
/**
* Use namespace to avoid conflict
*/
namespace PostType;
/**
* Class Event
* @package PostType
*
@yoga-
yoga- / randomPassword.php
Last active September 15, 2023 19:37
PHP random password generator - contains at least one lower case letter, one upper case letter, one number and one special character,
//generates a random password of length minimum 8
//contains at least one lower case letter, one upper case letter,
// one number and one special character,
//not including ambiguous characters like iIl|1 0oO
function randomPassword($len = 8) {
//enforce min length 8
if($len < 8)
$len = 8;
@vxnick
vxnick / gist:380904
Created April 27, 2010 15:52
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',