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 | |
$routeExists = Route::getRoutes()->hasNamedRoute('route.name'); | |
dd($routeExits); |
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 | |
// CSRF Protection | |
$this->beforeFilter('csrf', array('on' => 'post')); |
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 | |
/* | |
Plugin Name: Skeleton Widget | |
Description: A widget example for the widget article at photogabble.co.uk | |
*/ | |
class Carbontwelve_Skeleton_Widget extends WP_Widget { | |
/** | |
* Register widget with WordPress. |
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 | |
// Resizer and Image Manipulation | |
// Based on: http://forums.laravel.com/viewtopic.php?id=2648 | |
public function post_edit_logo($id) | |
{ | |
$rules = array( | |
'image' => 'image', | |
); |
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 Auth extends Laravel\Auth {} | |
/** | |
* @method static add(string $name, string $source, array $dependencies = array(), array $attributes = array()) | |
* @method static string styles() | |
* @method static string scripts() | |
*/ | |
class Asset extends Laravel\Asset {} | |
class Autoloader extends Laravel\Autoloader {} | |
class Bundle extends Laravel\Bundle {} |
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 | |
/* This needs some refactoring http://perishablepress.com/perfect-wordpress-title-tags-redux/ */ | |
if (function_exists('is_tag') && is_tag()) { | |
single_tag_title("Tag Archive for ""); | |
echo'" - '; | |
} elseif (is_archive()) { | |
wp_title(''); | |
echo ' Archive - '; | |
} elseif (is_search()) { | |
echo 'Search for "'.wp_specialchars($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 | |
function explodeArrayFunction($input) | |
{ | |
$array = preg_split('/(\s|[\.,\/])/', $input, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); | |
return array_values($array); | |
} | |
function implodeArrayFunction($input) | |
{ |
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
#!/usr/bin/env php | |
<?php | |
/** | |
* JSON/BSON encoding and decoding benchmark | |
* | |
* Now with native serializing! | |
* | |
* @copyright 2013 Trevor N Suarez | |
* @link http://blennd.com/ | |
* @author Trevor Suarez <rican7@gmail.com> |
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 | |
/** | |
* TestArrayWalk | |
* | |
* This is the code I have used when describing an issue I had with array_walk, closures and referencing $this | |
* within PHP version 5.3.3. | |
* | |
* The original stackoverflow question can be seen here: | |
* http://stackoverflow.com/questions/19033184/using-this-when-not-in-object-context-error-within-array-walk | |
* |
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 | |
$time_start = microtime(true); | |
$iterations = 20; | |
header('Content-Type: text/plain'); | |
function convert($size) | |
{ | |
$unit=array('b','kb','mb','gb','tb','pb'); |
OlderNewer