This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AF : Afghanistan | |
AX : Aland Islands | |
AL : Albania | |
DZ : Algeria | |
AS : American Samoa | |
AD : Andorra | |
AO : Angola | |
AI : Anguilla | |
AG : Antigua and Barbuda | |
AR : Argentina |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'rest_api_init', function ( $server ) { | |
$server->register_route( 'foo', '/foo', array( | |
'methods' => 'GET', | |
'callback' => function () { | |
return 'baz'; | |
}, | |
) ); | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<!-- | |
Author: A. Tres Finocchiaro, tres.finocchiaro@gmail.com | |
License: LGPL 2.1 | |
Depends: QZ Tray 2.0.0-alpha1+ | |
--> | |
<!-- Note: jquery is not needed in alpha2 --> | |
<script type="text/javascript" src="js/dependencies/jquery-1.11.3.min.js"></script> | |
<!-- Note: rsvp can be overriden via qz.setPromiseType(...) TODO: Get usage from @bberenz --> | |
<script type="text/javascript" src="js/dependencies/rsvp-3.1.0.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Determine csv delimiter | |
* | |
* @param resource $fileHandle - handle of csv file | |
* @return string - correct delimiter of csv file | |
*/ | |
function determineCsvDelimiter($fileHandle) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function slugify($string, $replace = array(), $delimiter = '-') { | |
// https://github.com/phalcon/incubator/blob/master/Library/Phalcon/Utils/Slug.php | |
if (!extension_loaded('iconv')) { | |
throw new Exception('iconv module not loaded'); | |
} | |
// Save the old locale and set the new locale to UTF-8 | |
$oldLocale = setlocale(LC_ALL, '0'); | |
setlocale(LC_ALL, 'en_US.UTF-8'); | |
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $string); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* NOTE: This gist is very old. You might want to check out recent forks | |
* like this one: https://github.com/Alexlytle/Wordpress_custom_route/blob/main/Wordpress_Custom_route.php | |
* (thanks @Alexlytle) If you have an improvement to this gist, please | |
* post a link in a comment for others who might benefit. Thanks! | |
* | |
* A class to create simple custom routes. | |
* |