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
describe('Product', function () { | |
it('must calculate its gross price by adding the VAT', function () { | |
var product = Product.create('A', 10); | |
expect(product.grossPrice()).toEqual(12); | |
}); | |
}); |
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
describe('A Cart with a several different products', function () { | |
var cart; | |
beforeEach(function () { | |
cart = Cart.create(); | |
}); | |
it('must have a #grossPriceSum() of the contained products', function () { | |
var product = Product.create('A', 10), | |
book = Book.create('B', 100); |
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
// The hash (#) and dot (.) symbols are a convention to mark if a method | |
// is called on an individual object or on the prototype. ".create" is | |
// called on the Cart prototype. #add are called on the derived objects. | |
describe('Cart', function () { | |
var cart; | |
beforeEach(function () { | |
cart = Cart.create(); | |
}); | |
describe('.create', function () { |
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
describe('Seminar', function () { | |
it('has a name', function () { | |
var seminar = SeminarFactory.create({name: 'JavaScript'}); | |
expect(seminar.getName()).toEqual('JavaScript'); | |
}); | |
it('has a price', function () { | |
var seminar = SeminarFactory.create({price: 10}); |
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 SeminarFactory = { | |
create: function (overwrite) { | |
var defaultData, | |
objectData; | |
defaultData = { | |
name: 'JavaScript basics', | |
price: 100 | |
}; |
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
$GLOBALS['translation'] = [ | |
'authentication_error' => 'You must authorise Facebook application!', | |
'geofence_restricted' => 'Sorry, this game is currently not available in your country.', | |
'terms_and_conditions' => 'Terms & Conditions', | |
'terms_and_conditions_url' => 'http://www.sky.com/tv/show/the-blacklist/article/facebook-game', | |
'privacy_policy' => 'Privacy Policy', | |
'privacy_policy_url' => 'http://help.sky.com/security/privacy/privacy-and-cookies-notice', | |
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 | |
/** | |
* @author Gajus Kuizinas <[email protected]> | |
* @version 1.7.2 (2013 07 28) | |
* @todo Consider adding layout attribute [label][input][name][/label][comment] | |
*/ | |
function input ($name, $label = null, array $input_options = null, array $row_options = []) { | |
if (!isset($row_options['order'])) { | |
$row_options['order'] = 'label-input'; | |
} |
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 distanceGeoPoints ($long1, $lat1, $long2, $lat2) { | |
$lat = deg2rad($lat2 - $lat1); | |
$long = deg2rad($long2 - $long1); | |
$a = sin($lat/2) * sin($lat/2) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * sin($long/2) * sin($long/2); | |
$c = 2 * atan2(sqrt($a), sqrt(1 - $a)); | |
$d = 6371 * $c; | |
return $d; | |
} |
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
Type: PDOException | |
Message: SQLSTATE[HY000]: General error: Extraneous additional parameters | |
File: [project]/ay/pdo.class.php | |
Line: 85 | |
Time: Mar 12, 2013 23:07 | |
public function fetchAll ($how = null, $class_name = null, $ctor_args = null) { | |
if ($how === PDO::FETCH_KEY_ASSOC) { | |
#$result = parent::fetchAll(PDO::FETCH_ASSOC); |
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
PDO::FETCH_ASSOC | |
array(2) { | |
[0]=> | |
array(3) { | |
["id"]=> | |
int(1) | |
["name"]=> | |
string(7) "English" | |
["code"]=> |