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
*, *:before, *:after { | |
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; | |
} |
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
$utc_time = ''; | |
$date_obj = new DateTime($utc_time, new DateTimeZone("UTC")); | |
$date_obj->setTimeZone("America/Los_Angeles"); | |
$display_date = $date_obj->format("Y-m-d H:i:s"); |
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
class DaysOfWeek | |
{ | |
const Sunday = 0; | |
const Monday = 1; | |
const Tuesday = 2; | |
const Wednesday = 3; | |
const Thursday = 4; | |
const Friday = 5; | |
const Saturday = 6; | |
} |
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 get_pagination( $current_page, $total_pages, $pagination_viewport ) { | |
$start_page = max( $current_page - $pagination_viewport, 1 ); | |
$end_page = min( $start_page + ( $pagination_viewport * 2 ), $total_pages ); | |
$start_page = max( $end_page - ( $pagination_viewport * 2 ), 1 ); | |
$pages = range( $start_page, $end_page ); | |
$first_page_link = $last_page_link = false; | |
if ( !in_array( 1, $pages ) ) { | |
$first_page_link = true; | |
} |
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
pathinfo( $file, PATHINFO_EXTENSION ); |
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
Trait Addable { | |
private $methods = array(); | |
public function addMethod( $name, $callable ) { | |
$this->methods[$name] = Closure::bind( $callable, $this, get_class() ); | |
} | |
public function __call( $method, array $args ) { | |
call_user_func_array( $this->methods[$method], $args ); |
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
class Combinations implements Iterator | |
{ | |
protected $c = null; | |
protected $s = null; | |
protected $n = 0; | |
protected $k = 0; | |
protected $pos = 0; | |
function __construct($s, $k) { | |
if(is_array($s)) { |
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 | |
ini_set( 'display_errors', 'On' ); | |
error_reporting( E_ALL ); | |
$strings = array( | |
'hello world there ok then' => 'hello world there ok then', | |
'hello' => ' hello ', | |
'ok then' => 'ok then', |