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
//*** This code is copyright 2002-2016 by Gavin Kistner, !@phrogz.net | |
//*** It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt | |
Date.prototype.customFormat = function(formatString){ | |
var YYYY,YY,MMMM,MMM,MM,M,DDDD,DDD,DD,D,hhhh,hhh,hh,h,mm,m,ss,s,ampm,AMPM,dMod,th; | |
YY = ((YYYY=this.getFullYear())+"").slice(-2); | |
MM = (M=this.getMonth()+1)<10?('0'+M):M; | |
MMM = (MMMM=["January","February","March","April","May","June","July","August","September","October","November","December"][M-1]).substring(0,3); | |
DD = (D=this.getDate())<10?('0'+D):D; | |
DDD = (DDDD=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][this.getDay()]).substring(0,3); | |
th=(D>=10&&D<=20)?'th':((dMod=D%10)==1)?'st':(dMod==2)?'nd':(dMod==3)?'rd':'th'; |
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
//*** This code is copyright 2002-2016 by Gavin Kistner, !@phrogz.net | |
//*** It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt | |
Date.prototype.customFormat = function(formatString){ | |
var YYYY,YY,MMMM,MMM,MM,M,DDDD,DDD,DD,D,hhhh,hhh,hh,h,mm,m,ss,s,ampm,AMPM,dMod,th; | |
YY = ((YYYY=this.getFullYear())+"").slice(-2); | |
MM = (M=this.getMonth()+1)<10?('0'+M):M; | |
MMM = (MMMM=["January","February","March","April","May","June","July","August","September","October","November","December"][M-1]).substring(0,3); | |
DD = (D=this.getDate())<10?('0'+D):D; | |
DDD = (DDDD=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][this.getDay()]).substring(0,3); | |
th=(D>=10&&D<=20)?'th':((dMod=D%10)==1)?'st':(dMod==2)?'nd':(dMod==3)?'rd':'th'; |
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 cleanInputData(){ | |
$sanitized = array(); | |
foreach($_POST as $cur){ | |
$str = trim($cur); | |
$str = mb_convert_encoding($str, 'UTF-8', 'UTF-8'); | |
$str = htmlentities($str, ENT_QUOTES, 'UTF-8'); | |
array_push($sanitize, $str); | |
} | |
return $sanitized; | |
} |
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
emailRegex = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$/igm; |
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 inArrayI($needle, $haystack) { | |
return in_array(strtolower($needle), array_map('strtolower', $haystack)); | |
} |
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
if (count($_FILES)) { | |
foreach ($_FILES as $file) { | |
$tmp = explode('.', $file['name']); | |
$ext = end($tmp); | |
if ($this->inArrayI($ext, $this->img_exts)) { | |
// do smth | |
} | |
} | |
} |
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 | |
require 'DBConnector.php'; | |
class DBProcessor | |
{ | |
protected $textFieldTypes = ['text', 'blob', 'varchar', 'longtext', 'tinytext', 'text', 'mediumtext']; | |
public $replacement; | |
public $replacementWith; |
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 findFiles($directory, $extensions = array()) { | |
function glob_recursive($directory, &$directories = array()) { | |
foreach(glob($directory, GLOB_ONLYDIR | GLOB_NOSORT) as $folder) { | |
$directories[] = $folder; | |
glob_recursive("{$folder}/*", $directories); | |
} | |
} | |
glob_recursive($directory, $directories); | |
$files = array (); | |
foreach($directories as $directory) { |
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
Show hidden characters
{ | |
"extends": [ | |
"tslint:latest", | |
"tslint-react", | |
"tslint-eslint-rules", | |
"tslint-config-prettier" | |
], | |
"rules": { | |
"ordered-imports": false, | |
"no-submodule-imports": false, |
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
{ | |
"tabWidth": 2, | |
"semi": false, | |
"singleQuote": true, | |
"trailingComma": "es5", | |
"bracketSpacing": true, | |
"arrowParens": "always", | |
"printWidth": 120 | |
} |
OlderNewer