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
/** | |
* Loads an HTML document from a URL (or a portion of it via the “selector” parameter) within a “target” element. | |
* If present, executes upon completion, a callback. | |
* | |
* Example usage: | |
* loadContent('#target', 'https://www.mypage.tld'); | |
* loadContent('#target', 'https://www.mypage.tld', '#selector'); | |
* loadContent('#target', 'https://www.mypage.tld', '#selector', () => console.log('Hi!')); | |
* loadContent('#target', 'https://www.mypage.tld', '#selector', myCallback); | |
* loadContent('#target', 'https://www.mypage.tld', '', myCallback); |
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
const checkURL = (url: string): boolean => { | |
try { | |
return Boolean(new URL(url)); | |
} catch(e) { | |
return false; | |
} | |
} | |
const isEmpty = (args: any): boolean => (args === "" || args === 0 || args === "0" || args === null || args === false || args === undefined || (Array.isArray(args) && args.length === 0)); |
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
/** | |
* Loads an HTML document from a URL (or a portion of it via the “selector” parameter) within a “target” element. | |
* If present, executes upon completion, a callback. | |
* | |
* Example usage: | |
* loadContent('#target', 'https://www.mypage.tld'); | |
* loadContent('#target', 'https://www.mypage.tld', '#selector'); | |
* loadContent('#target', 'https://www.mypage.tld', '#selector', () => console.log('Hi!')); | |
* loadContent('#target', 'https://www.mypage.tld', '#selector', myCallback); | |
* loadContent('#target', 'https://www.mypage.tld', '', myCallback); |
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 | |
function highlightText(string $str, array $keyw = [], bool $accurate = false) | |
{ | |
if (empty($keyw)) return false; | |
$sText = implode('|', $keyw); | |
$match = ($accurate) ? '@\b(' . $sText . ')\b@si' : '@(' . $sText . ')@si'; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Password Strength Meter</title> | |
<!-- Bootstrap --> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> | |
<!-- Font Awesome Library --> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" /> |
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 | |
class PushMessage { | |
private $url = 'https://fcm.googleapis.com/fcm/send'; | |
private $serverApiKey = ""; | |
private $devices = array(); | |
function __construct($apiKeyIn){ | |
$this->serverApiKey = $apiKeyIn; |
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 sequence = ''; | |
var timeout; | |
var reset_s = function() { | |
sequence = ''; | |
} | |
$(document).on("keypress", function(event) { |
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 | |
$csv_file = __DIR__."/contacts.csv"; | |
/** | |
* Structure of the CSV file | |
* "Title","First Name","Middle Name","Last Name","Suffix","Company","Department","Job Title","Business Street","Business Street 2","Business Street 3","Business City","Business State","Business Postal Code","Business Country/Region","Home Street","Home Street 2","Home Street 3","Home City","Home State","Home Postal Code","Home Country/Region","Other Street","Other Street 2","Other Street 3","Other City","Other State","Other Postal Code","Other Country/Region","Assistant's Phone","Business Fax","Business Phone","Business Phone 2","Callback","Car Phone","Company Main Phone","Home Fax","Home Phone","Home Phone 2","ISDN","Mobile Phone","Other Fax","Other Phone","Pager","Primary Phone","Radio Phone","TTY/TDD Phone","Telex","Account","Anniversary","Assistant's Name","Billing Information","Birthday","Business Address PO Box","Categories","Children","Directory Server","E-mail Address","E-mail Type","E-mail Display Name","E-mail 2 Address"," |
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
function getBaseURL() { | |
var url = location.href; | |
var baseURL = url.substring(0, url.indexOf('/', 14)); | |
if (baseURL.indexOf('http://localhost') != -1) { | |
var url = location.href; | |
var pathname = location.pathname; | |
var index1 = url.indexOf(pathname); |
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 | |
function customErrorHandler($errno, $errstr, $errfile, $errline) { | |
if (!(error_reporting() & $errno)) | |
return true; | |
switch ($errno) { | |
case E_USER_ERROR: |
NewerOlder