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 | |
echo "Hello world"; |
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 MercyfulFate; | |
use MercyfulFate\KingDiamond; | |
class KingDiamondTest extends \PHPUnit_Framework_TestCase | |
{ | |
/** | |
* @var MercyfulFate\Priest | |
*/ |
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
$this->addElement('text', 'email', array( | |
'label' => 'Your email address', | |
'required' => true, | |
'validators' => array( | |
array('EmailAddress'), | |
array( | |
new \Zend_Validate_Db_NoRecordExists(array('table' => 'accounts', 'field' => 'email')), | |
'breakChainOnFailure' => true | |
), | |
array(new \Zend_Validate_Db_NoRecordExists(array('table' => 'beta_invites', 'field' => 'email'))) |
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 multiple_cycle($limit, $numbers) | |
{ | |
$count = 0; | |
$index = 0; | |
$numbersLength = count($numbers); | |
for ($i = 1; $i <= $limit; $i++) { | |
if ($i % $numbers[$index] == 0) { |
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
/** | |
* Dumps information about a variable. Convenience wrapper for var_dump() | |
* | |
* @param mixed $expression The variable you want to dump. | |
* @param mixed $expression,... unlimited OPTIONAL number of additional variables to display with d() | |
* @return void | |
*/ | |
function d($expression) { | |
var_dump($expression); | |
} |
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 http = require('http'); | |
http.createServer(function(request, response) { | |
response.writeHead(200); | |
response.end("Hello, dogg!"); | |
}).listen(9090); | |
console.log('Listening on port 9090'); |
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 http = require('http'); | |
http.createServer(function(request, response) { | |
response.writeHead(200); | |
response.end("Hello, dogg!"); | |
}).listen(9090); | |
console.log('Listening on port 9090'); |
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 -v | |
PHP 5.3.14 (cli) (built: Aug 24 2012 12:56:43) | |
Copyright (c) 1997-2012 The PHP Group | |
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies | |
# php -a | |
Interactive shell | |
php > var_dump(directory_separator) | |
php > var_dump(DIRECTORY_SEPARATOR); |
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
exec { "sed -i 's/www-data/vagrant/g' /etc/apache2/envvars": | |
onlyif => "/bin/grep -c 'www-data' /etc/apache2/envvars", | |
notify => Service['apache2'], | |
require => Package['apache2'], | |
} |
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 | |
add_filter('nav_menu_css_class', 'namespace_menu_classes', 10, 2); | |
function namespace_menu_classes($classes , $item) | |
{ | |
if (get_post_type() == 'company' || is_archive('company')) { | |
$classes = str_replace('current_page_parent', '', $classes); | |
if (strpos($item->url, 'portfolio') !== false) { |
OlderNewer