<!-- pwa -->
<link rel="manifest" href="_pwa/manifest.json" />
<meta name="theme-color" content="#000000" />
<link rel="apple-touch-icon" href="_pwa/icon-192x192.png" />
<script>
// register service worker
window.addEventListener('load', () => {
This file contains hidden or 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
~ | |
(?(DEFINE) | |
(?<entity> | |
& | |
( | |
[a-z][a-z0-9]+ # named entity | |
| | |
\#\d+ # decimal number | |
| |
This file contains hidden or 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 | |
// INTERFACES | |
interface WriterFactory | |
{ | |
public function createCsvWriter(): CsvWriter; | |
public function createJsonWriter(): JsonWriter; | |
} | |
This file contains hidden or 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 | |
// https://www.youtube.com/watch?v=M3_xnTK6-pA?t=44m18s | |
// http://eddmann.com/posts/implementing-and-using-memoization-in-php/ | |
//$memoize = function ($function) { | |
function memoize($function) { | |
return function () use ($function) { | |
static $cache = []; | |
$args = func_get_args(); | |
$key = md5(serialize($args)); | |
if (empty($cache[$key])) { |
http://www.xminder.com/number.check.php?number=5551234567
http://www.xminder.com/number.check.php?number=<10digitnumber>
'nuff said
Also, npm module for node.js:
This file contains hidden or 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
var FormRepo = function (namespace) { | |
/// <summary>Persistent form values, saves to localStorage</summary> | |
/// <param name="namespace" type="String">the namespace to store values in localStorage</param> | |
// should also protect per page, since we could have the same forms in various places | |
this.N = namespace + '.' + window.location.pathname; | |
}; | |
$.extend(FormRepo.prototype, { | |
namespace: function (key) { | |
return this.N + '.' + key; |
This file contains hidden or 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 | |
/* | |
ErrorHandler Class | |
By James King | |
v0.1 Alpha | |
WARNING: This class is still in ALPHA phase. Not recommended for production. | |
Manages and handles any PHP errors found in your script. |
This file contains hidden or 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 | |
/** | |
* Namespace Migration Script | |
* | |
* @author Rasmus Schultz <[email protected]> | |
* @license http://www.gnu.org/licenses/gpl-3.0.txt | |
* | |
* This script will scan through an entire PHP codebase and rewrite the | |
* scripts, adding a namespace clause based on the directory structure, |