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 | |
$dspam = array("a href", "href", "[url", "[link", "www", "http", "@", "[at]", "mailto"); | |
function checkExtLink($text, $dspam) { | |
$resp = 0; | |
if (is_array($dspam) && !empty($dspam)) { |
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 | |
// Text to filter and to censure | |
$text_to_check = "Lorem ipsum DOLOR Bullshit"; | |
// List of words to censor | |
$blacklist_words = array("God", "em", "shit", "pig"); | |
//$blacklist_words = "shit"; | |
// Function used to generate a random string length as word to replace |
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 | |
/** | |
* Search and replace words with blacklist - v. 0.2 | |
* ------------------------------------------------------------ | |
* Optimized version - Thanks to my friend: | |
* Flavio 'darkjoker' Giobergia - https://github.com/darkjoker | |
* ------------------------------------------------------------ | |
* | |
* The generation of random characters, has been eliminated, to make |
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
window.create_widget = function() { | |
if (jQuery("#box-dynamic").length) | |
$('#box-dynamic').html("Oh Yes"); | |
} | |
window.loadjQuery = function(url, success) { | |
var script = document.createElement('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 | |
// Check if var is a valid date | |
function validateDate($date, $format = 'Y-m-d H:i:s') { | |
$d = DateTime::createFromFormat($format, $date); | |
return $d && $d->format($format) == $date; | |
} |
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 customErrorHandler($errno, $errstr, $errfile, $errline) { | |
if (!(error_reporting() & $errno)) | |
return true; | |
switch ($errno) { | |
case E_USER_ERROR: |
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
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 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 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 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; |