This file contains hidden or 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
#!/bin/bash | |
#save this file somewhere in your path and make it executable | |
#then you can just run git-submodule-recurse to recursively init / update your git submodules | |
git submodule init | |
git submodule update | |
git submodule foreach git-submodule-recurse |
This file contains hidden or 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 Foobar { | |
static $global_value; | |
private $_local_value; | |
public function __construct($local_val = null) { | |
if(false == is_null($local_val)) { | |
$this->_local_value = $local_val; | |
} |
This file contains hidden or 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
product_list = list of selected products and quantities; | |
global_dunnage = percentage defined by admin; | |
fudge_factor = percentage defined by admin; | |
if ( total_cost meets freight override conditions ): | |
return freight calculation; | |
exit; | |
else: |
This file contains hidden or 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
<pre> | |
<?php | |
echo shell_exec('whoami && ps'); | |
echo shell_exec('ps'); | |
?> | |
</pre> |
This file contains hidden or 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 | |
require_once 'PHPUnit/Framework.php'; | |
function foobar(Array $array) { | |
} | |
class FoobarTest extends PHPUnit_Framework_TestCase { | |
/** | |
* @expectedException PHPUnit_Framework_Error |
This file contains hidden or 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 | |
require_once 'PHPUnit/Framework.php'; | |
class TimeLoggerListener implements PHPUnit_Framework_TestListener { | |
private $_filename; | |
private $_handle; | |
public function __construct($filename) { | |
$this->_filename = $filename; | |
} |
This file contains hidden or 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 MyTestCase extends PHPUnit_Framework_TestCase { | |
public function testBoolEquality() { | |
$this->assertTrue((true == 'true')); | |
$this->assertTrue((true == (bool)'true')); | |
$this->assertTrue((true == 'false')); | |
$this->assertTrue((true == (bool)'false')); | |
$this->assertTrue((true == (bool)'1')); | |
$this->assertTrue((false == (bool)'0')); | |
$this->assertFalse((true == '')); |
This file contains hidden or 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 | |
/** | |
* works around PHP's shitty floating point math to properly round numbers | |
* | |
* USE THIS EVERYWHERE BECAUSE FLOATS FUCKING SUCK | |
*/ | |
function super_round($number, $precision = 0) { | |
$power = bcpow(10, $precision); | |
$rounded = round(bcmul($number, $power, 1), 0); | |
return bcdiv($rounded, $power, $precision); |
This file contains hidden or 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
<Response> | |
<Say>I will eat your children.</Say> | |
<Play>http://dl.dropbox.com/u/392166/callboxen/9.wav</Play> | |
<Sms to="555-555-5555">Gatebot-9000: I probably just let a murderer into the apartment complex. So be ready for that.</Sms> | |
</Response> |
This file contains hidden or 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
OlderNewer