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 the total number of elements that match a given criteria. | |
* | |
* @param ElementCriteriaModel $criteria An element criteria model that defines the parameters for the elements | |
* we should be counting. | |
* | |
* @return int The total number of elements that match the criteria. | |
*/ |
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
CREATE OR REPLACE VIEW sabermetrics_batting AS | |
SELECT | |
batting.*, | |
-- PA - Plate Appearances | |
(batting.AB + batting.BB + batting.HBP + batting.SF + batting.SH) as PA, | |
-- BB% - Walk Percentage (http://www.fangraphs.com/library/offense/rate-stats/) | |
round((batting.BB / (batting.AB + batting.BB + batting.HBP + batting.SF + batting.SH)), 3) as BBpct, |
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 | |
abstract class AbstractEntity extends AbstractValueObject | |
{ | |
/** | |
* Offset Set | |
* | |
* @param mixed $offset | |
* @param mixed $value | |
* |
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
<!DOCTYPE html> | |
<head> | |
{# Base #} | |
{% includeCssFile 'layouts/base/css/base.css' %} | |
{% includeJsFile 'layouts/base/js/base.js' %} | |
{# Header #} | |
{% includeCssFile 'modules/header/css/header.css' %} | |
{% includeJsFile 'modules/header/js/header.js' %} |
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 | |
namespace Craft; | |
/** | |
* Craft by Pixel & Tonic | |
* | |
* @package Craft | |
* @author Pixel & Tonic, Inc. | |
* @copyright Copyright (c) 2014, Pixel & Tonic, Inc. | |
* @license http://buildwithcraft.com/license Craft License Agreement |
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
craft()->on('entries.saveEntry', function(Event $event) { | |
$entry = $event->params['entry']; | |
if( $event->params['entry']->sectionId == 4 ) { | |
craft()->request->redirect( '/admin/nameofplugin' ); | |
} |
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 | |
$types = explode( ",", $_GET['types'] ); | |
foreach( $workoutmoves AS $workoutmove ): | |
?> | |
<li> | |
<input class="check_box" type="checkbox" <?php in_array( $workoutmove->slug, $types ) ? 'checked' : ''; ?> value="<?php echo $workoutmove->slug; ?>"> <?php echo $workoutmove->name; ?> | |
</li> | |
<?php endforeach; ?> |
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
// Get the host | |
$host = $_SERVER['HTTP_HOST']; | |
// Define the site base | |
$site_base = 'example.com'; | |
// WP subdirectory | |
$wp_subdirectory = ''; | |
if( $host === 'local.' . $site_base || $host === 'localhost:8888' ){ |
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 | |
/** | |
* The base configurations of the WordPress. | |
* | |
* This file has the following configurations: MySQL settings, Table Prefix, | |
* Secret Keys, WordPress Language, and ABSPATH. You can find more information | |
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing | |
* wp-config.php} Codex page. You can get the MySQL settings from your web host. | |
* | |
* This file is used by the wp-config.php creation script during the |
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 | |
/* Replace database connection information in wp-config.php */ | |
// Get the host | |
$host = $_SERVER['HTTP_HOST']; | |
if( $host === 'local.website.com' || $host === 'localhost:8888' ){ | |
// ** MySQL settings - You can get this info from your web host ** // |
NewerOlder