Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
<?php | |
/** | |
* This code is intended to be added to your wp-config.php file just below the top comment block. | |
* It should replace the existing define('DB_*') statements. You can add or remove sections | |
* depending on the number of environments you intend to setup. You should change all values of | |
* DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST for each environment, making them all distinct | |
* for security purposes. | |
*/ | |
// determine the current environment |
<?php | |
namespace app\tests\cases\controllers; | |
use app\tests\mocks\MockArticlesController; | |
use app\tests\mocks\action\MockControllerRequest as Request; //Mocking the Request | |
class ArticlesControllerTest extends \lithium\test\Unit { | |
protected $_controller; |
<?php | |
use lithium\core\ErrorHandler; | |
use lithium\action\Response; | |
use lithium\net\http\Media; | |
use lithium\analysis\Debugger; | |
use lithium\analysis\Logger; | |
use lithium\core\Environment; | |
/** |
<?php | |
namespace app\controllers; | |
use \app\models\Taxonomies; | |
use MongoId; | |
class CategoriesController extends \lithium\action\Controller { | |
/** | |
* @var Protected $_type - protected variable which define type of taxonomy, | |
* Can be omited if there is no need for additional types of taxonomy. |
<?php | |
add_action( 'after_setup_theme', 'bootstrap_setup' ); | |
if ( ! function_exists( 'bootstrap_setup' ) ): | |
function bootstrap_setup(){ | |
add_action( 'init', 'register_menu' ); | |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
// * iOS zooms on form element focus. This script prevents that behavior. | |
// * <meta name="viewport" content="width=device-width,initial-scale=1"> | |
// If you dynamically add a maximum-scale where no default exists, | |
// the value persists on the page even after removed from viewport.content. | |
// So if no maximum-scale is set, adds maximum-scale=10 on blur. | |
// If maximum-scale is set, reuses that original value. | |
// * <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=2.0,maximum-scale=1.0"> | |
// second maximum-scale declaration will take precedence. | |
// * Will respect original maximum-scale, if set. | |
// * Works with int or float scale values. |
use lithium\action\Dispatcher; | |
//Allow admin continuation routes to be made. | |
Dispatcher::config( | |
array( | |
'rules' => array( | |
'admin' => array('action' => 'admin_{:action}') | |
) | |
) | |
); |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Preventing kernel panics - VirtualBox 4.1 and Mac OS X Lion 10.7. | |
# | |
# This happens on my Macbook Air Mid-2011 Core i7. Every few hours, with | |
# one or (particularly) more VMs running, you will get a kernel panic. | |
# | |
# Some reading: | |
# https://www.virtualbox.org/ticket/9359 |