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 chargeCreditCard($detail) { | |
$API_USERNAME = '-USERNAME-'; | |
$API_PASSWORD = '-PASSWORD'; | |
$API_CERTIFICATE = '-SSL-CERT-'; | |
$API_SIGNATURE = ''; | |
$API_ENDPOINT = 'https://api.paypal.com/nvp'; | |
$PAYPAL_URL = 'https://www.paypal.com/webscr&cmd=_express-checkout&token='; | |
$VERSION = '51.0'; | |
$return = array( |
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 | |
ini_set('display_errors', '1'); | |
error_reporting(E_ALL | E_STRICT); | |
class testRef { | |
function test (&$parm1, &$parm2) { | |
echo '<br>In testRef::test(), param1: '.$parm1; | |
echo '<br>In testRef::test(), param2: '.$parm2; | |
} | |
} |
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
/* | |
blackCoffee is the ultra-light, ultra-fast alternative to jQuery. Our slogan is: | |
--> Write the same amount, do an equal amount as you otherwise may have done | |
It isn't very catchy -- now taking suggestions for a better slogan! | |
*/ | |
var blackCoffee = function (selector) { | |
if (typeof selector != 'string') | |
return null; | |
if (selector.match('#')){ |
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 parse_address($address){ | |
$dir=array( | |
'N'=>'N','S'=>'S','E'=>'E','W'=>'W','NW'=>'NW','SW'=>'SW','NE'=>'NE','SE'=>'SE', | |
'North'=>'N','South'=>'S','East'=>'E','West'=>'W','Northwest'=>'NW','Southwest'=>'SW','Northeast'=>'NE','Southeast'=>'SE' | |
); | |
$type=array( | |
'ave'=>'Ave','blvd'=>'Blvd','st'=>'St','wy'=>'Wy','cir'=>'Cir','dr'=>'Dr','ln'=>'Ln','Pl'=>'Pl','Rd'=>'Rd', | |
'Bvd'=>'Blvd', | |
'Avenue'=>'Ave','Boulevard'=>'Blvd','Street'=>'St','Way'=>'Wy','Circle'=>'Cir','Drive'=>'Dr','Lane'=>'Ln','Place'=>'Pl','Road'=>'Rd' |
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 MathIsFun { | |
private $someInterface = null; | |
public function __construct(iSomeInterface $dependency) { | |
$this->someInterface = $dependency; | |
} | |
public function add($number=0) { | |
return $number + $this->someInterface->getNumber(); | |
} | |
} |
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 | |
/** | |
* Sample of a basic wrapper class for PDO. | |
* | |
* This is provided as a demonstration only and no warranty is intended | |
* about the completeness or soundness of this snippet. | |
* | |
* Use: | |
* |
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 | |
require_once('../vendor/autoload.php'); // composer autoload | |
class Foo { | |
public $someProperty = 'val1'; | |
} | |
class Bar { | |
public function __construct($valueFromFoo){ |