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/local/bin/php | |
<?php | |
/** | |
* Pre-commit Subversion script. | |
* | |
* Forces the commit message to have a line like | |
* review: 42 | |
* and checks that the review has received a Ship It! from | |
* a peer. | |
* @author Omni Adams <omni@digitaldarkness.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
#!/usr/local/bin/php | |
<?php | |
/** | |
* Pre-commit Subversion script. | |
* | |
* @author Omni Adams <omni@digitaldarkness.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
Verifying that "omnicolor.id" is my Blockstack ID. https://explorer.blockstack.org/name/omnicolor.id |
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 that tries to send a header. | |
*/ | |
class SendsHeaders { | |
/** | |
* Send a header to the user's browser. | |
*/ | |
public function sendHeader() { | |
header('This is a header', true, 400); |
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 | |
define('RUN_ITERATIONS', 100000); | |
function avg($array) { | |
return array_sum($array) / count($array); | |
} | |
function ifseta($arr, $k, $default = null) { | |
return isset($arr[$k]) ? $arr[$k] : $default; | |
} |
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
class Foo { | |
public function addAndSquare($bar, $baz) { | |
$tmp = $this->add($bar, $baz); | |
return $this->multiply($tmp, $tmp); | |
} | |
protected function add($foo, $bar) { | |
return Calculator::add($foo, $bar); | |
} |
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
/** | |
* Static calculator class. | |
* | |
* There's no way to dependency inject this for | |
* mocking it out while testing. | |
*/ | |
class Calculator { | |
private function __construct() {} | |
public static function add($a, $b) { |
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
class Foo { | |
public function addAndSquare($bar, $baz) { | |
$tmp = Calculator::add($bar, $baz); | |
return Calculator::multiply($tmp, $tmp); | |
} | |
} |
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/local/bin/php | |
<?php | |
/** | |
* Pre-commit Subversion script. | |
* @author Omni Adams <omni@digitaldarkness.com> | |
*/ | |
/** | |
* Path to the awk binary. |
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/local/bin/php | |
<?php | |
/** | |
* Pre-commit Subversion script that runs unit tests. | |
* @author Omni Adams <omni@digitaldarkness.com> | |
* @copyright 2010 Digital Darkness | |
*/ | |
/** |
NewerOlder