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
// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach | |
if ( !Array.prototype.forEach ) { | |
Array.prototype.forEach = function(fn, scope) { | |
for(var i = 0, len = this.length; i < len; ++i) { | |
fn.call(scope || this, this[i], i, this); | |
} | |
} | |
} | |
// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/indexOf |
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 | |
// Category | |
// Pod is the first tab but is last for purpose of category numbers | |
$categoryNames = array('Propulsion', 'Control', 'Structural', 'Aero', 'Utility', 'Science', 'Pods'); | |
$subcategoryOrder = array(); | |
// Order of pod parts | |
// Pods are not separated into subcategory |
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
var THRUST = 5; | |
var PLANET_RADIUS = 200000; | |
var PLANET_MASS = 9.7600236e20; | |
var PLANET_SIDEREAL_VELOCITY = 9.0416; | |
var G = 6.67384e-11; | |
var ISP = 350; | |
var FUEL_RATE = THRUST / (ISP * 9.81); | |
var TARGET_ALT = 40000; | |
var DRY_MASS = 0.39875; | |
var FUEL_MASS = 0.191025; |
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
#!/usr/bin/php | |
<?php | |
/** | |
* PHP Token | |
*/ | |
class Token { | |
public $type; | |
public $text; | |
public function __construct($type, $text) { |
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
#!/usr/bin/php | |
<?php | |
/** | |
* PHP Token | |
*/ | |
class Token { | |
public $type; | |
public $text; | |
public $lineNo; | |
public $colNo; |
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 'vendor/autoload.php'; | |
// Import the Pharborist classes | |
use Pharborist\Filter; | |
use Pharborist\Node; | |
use Pharborist\Parser; | |
use Pharborist\TokenNode; | |
use Pharborist\TopNode; |
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 | |
/** | |
* Alters a multi search query to add node access checks. | |
* | |
* @param SearchApiMultiQueryInterface $query | |
* The executed search query. | |
*/ | |
function hook_search_api_multi_query_alter(SearchApiMultiQueryInterface $query) { | |
global $user; | |
$indexes = $query->getIndexes(); |
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 | |
function argToString($arg, $maxLength = false) { | |
if (is_null($arg)) { | |
return 'null'; | |
} elseif (is_array($arg)) { | |
return 'Array'; | |
} elseif (is_object($arg)) { | |
return 'Object(' . get_class($arg) . ')'; | |
} elseif (is_bool($arg)) { | |
return $arg ? 'true' : 'false'; |
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
"use strict"; | |
/** | |
* High performance Vector library. | |
* | |
* Constructing vectors is expensive and therefore these functions take | |
* the required operands and a parameter to output the result into. | |
*/ | |
var Vector = {}; |
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 | |
use Behat\Mink\Mink; | |
use Behat\Mink\Selector\CssSelector; | |
use Behat\Mink\Session; | |
use Behat\Mink\Element\Element; | |
use Behat\Mink\Element\NodeElement; | |
abstract class BrowserTestCase extends PHPUnit_Framework_TestCase { | |
/** |
OlderNewer