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 Animal | |
{ | |
/** @type string */ | |
protected $name; | |
/** | |
* @param string $name | |
*/ | |
public function __construct($name) |
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 Autoloader | |
{ | |
/** | |
* @param string $className | |
*/ | |
public function autoload($className) | |
{ | |
require str_replace('\\', '/', $className) . '.php'; | |
} |
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 Autoloader | |
{ | |
/** | |
* @param string $className | |
*/ | |
public function autoload($className) | |
{ | |
require str_replace('\\', '/', $className) . '.php'; | |
} |
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 spec\Money; | |
use PhpSpec\ObjectBehavior; | |
use Money\Currency; | |
use Money\Money; | |
class MoneySpec extends ObjectBehavior | |
{ | |
public function it_should_be_initializable(Currency $currency) |
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 Doctrine1\TableGateway; | |
use \Doctrine_Record as Record; | |
use \Doctrine_Query as Query; | |
use \Doctrine1\QuerySpecifications\Specification; | |
abstract class DoctrineTable | |
{ | |
protected $record; |
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
{ | |
"name": "drupal/drupal", | |
"description": "Drupal is an open source content management platform powering millions of websites and applications.", | |
"type": "drupal-core", | |
"license": "GPL-2.0+", | |
"repositories": [ | |
{ | |
"type": "vcs", | |
"url": "https://github.com/MontealegreLuis/DrupalAppConsole.git" | |
} |
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 CreateAjax() { | |
var objetoAjax = false; | |
try { | |
/* Para navegadores distintos a Internet Explorer */ | |
objetoAjax = new ActiveXObject("Msxml2.XMLHTTP"); | |
} catch (e) { | |
try { | |
/* Para explorer */ | |
objetoAjax = new ActiveXObject("Microsoft.XMLHTTP"); | |
} catch (E) { |
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 | |
$now = new DateTime('now', new DateTimeZone('America/Mexico_City')); | |
$twoHoursAgo = clone $now; | |
$twoHoursAgo = $twoHoursAgo->sub(new DateInterval('PT2H')); | |
$diff = $now->diff($twoHoursAgo); | |
echo $diff->format("%H hours\n"); |
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 | |
// /tests/functional/Application/DataFixture/VenueTypeFixture.php | |
namespace Application\DataFixture; | |
use \Doctrine\DBAL\Connection; | |
class VenueTypeFixture | |
{ | |
protected $connection; |
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 | |
$array = array('pedro', 'juan', 'paco', 'pedro'); | |
$repeated = array_filter(array_count_values($array), function($count) { | |
return $count > 1; | |
}); | |
foreach ($repeated as $key => $value) { | |
echo "Key '$key' is repeated $value times <br />"; | |
} |
NewerOlder