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 | |
/* | |
Tiny PHP Helper Class to parse and work with URLs and its GET parameters | |
by Xavi Esteve (c) 2017 (MIT License) | |
Example: | |
$u = new Url; | |
$u->param('utm_source', 'xaviesteve.com'); | |
$u->param('id', 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
<?php | |
ob_start(); | |
// Do whatever | |
$buffer = ob_get_clean(); |
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 | |
if ( isset( $info['first_name'] ) ){ | |
$first_name = $info['first_name']; | |
}else{ | |
$first_name = substr( $info['full_name'], 0, strrpos($info['full_name'], ' ') ); | |
} | |
$first_name = ucwords( strtolower( $first_name ) ); |
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 | |
if ( isset( $info['first_name'] ) ){ | |
$first_name = $info['first_name']; | |
}else{ | |
$first_name = substr( $info['full_name'], 0, strrpos($info['full_name'], ' ') ); | |
} | |
$first_name = ucwords( strtolower( $first_name ) ); |
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 shows = {"shows":["12 Monkeys","19-2 (2014)","2 Broke Girls","24","60 Minutes Australia","60 Minutes US","8 Out of 10 Cats","A D The Bible Continues","A to Z","A Young Doctor's Notebook","About a Boy","Adventure Time","Air Crash Investigation - Mayday","Alaska: The Last Frontier","Alaskan Bush People","Ali G: Rezurection","Allegiance","Almost Human","Almost Royal","Alpha House","Ambassadors","America Declassified","America Unearthed","America's Got Talent","America's Next Top Model","American Crime","American Dad!","American Horror Story","American Idol","American Ninja Warrior","American Odyssey","American Pickers","American Restoration","Ancient Aliens","Anger Management","Another Period","Anthony Bourdain: Parts Unknown","Antiques Roadshow UK","Aqua TV Show Show","Aquarius (US)","Archer (2009)","Arctic Air","Arrow","At Midnight","Atlantis","Attack on Titan","Avengers Assemble (2013)","Awkward.","Axe Cop","Baby Daddy","Babylon","Bachelor in Paradise","Back in the Game","Backstrom","Bad Education","Bad I |
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 compressHtml($html) { | |
return preg_replace( ['/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s'], ['>', '<', '\\1'], $html ); | |
} |
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 | |
define('LANGUAGES_PATH', 'languages/'); | |
define('DEFAULT_LANGUAGE', 'en'); | |
define('LANGUAGE_COOKIE_TIME', 1314000 ); // 3600 * 365 = 1314000; (1 year) | |
define('COOKIE_DOMAIN', '.xaviesteve.com'); | |
/* | |
Usage: |
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 { | |
color: #444; | |
background: #FDFDFF; | |
font-family: 'Helvetica Neue', HelveticaNeue, sans-serif; | |
font-size: 16px; | |
line-height: 1.618em; | |
margin: 0 auto; | |
max-width: 50em; | |
text-rendering: optimizeLegibility; | |
} |
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
@media all and (max-width: 300px) { | |
} |
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 | |
/** | |
* returns positive if male, negative if female | |
*/ | |
function gender( $s ) | |
{ | |
$gender = 0; // female - , + male | |
$letters = array( |