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
#everything past the first '\' gets removed | |
export PATH=${PATH/\/path\/to\/remove:} |
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
/** | |
* Rename these to the form input names you are going to use. | |
* When you create a new attribute in Properties->Settings->Developer | |
* the form input name will appear greyed out under the attribute name | |
*/ | |
define('SPRP_SEARCH_FROM_KEY', 'price_from_per_month'); | |
define('SPRP_SEARCH_TO_KEY', 'price_to_per_month'); | |
function parse_search(){ |
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/bin/env node | |
/** | |
* Mock https.serverResponse | |
* @type {Object} | |
*/ | |
var mockResponse; | |
Eventer = function(){ | |
events.EventEmitter.call(this); |
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
REPORTER = dot | |
test: | |
@npm install | |
@NODE_ENV= ./node_modules/.bin/mocha \ | |
--reporter $(REPORTER) \ | |
--recursive \ | |
--ui bdd \ | |
tests |
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
/** | |
* Detect delimiter. | |
* @param integer $depth The number of lines from csv file to work with. | |
* @param array $chars Optional. An array of characters to guess. | |
* @param array $lines Sample lines from csv file. | |
* @return string Returns the best guess. | |
*/ | |
private function detect_delimiter( $depth=20, $chars=null, $lines ){ | |
if( !$chars ) |
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
$StartDate = @strtotime("Jan 2003"); | |
$StopDate = @strtotime("Apr 2004"); | |
/** | |
* Gets list of months between two dates | |
* @param int $start Unix timestamp | |
* @param int $end Unix timestamp | |
* @return array | |
*/ | |
function echoDate( $start, $end ){ |
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
/** | |
* Sort a multidimensional array by datetime. | |
* usage: | |
* usort($array, 'sortByOrder'); | |
*/ | |
function sortByDate($a, $b) { | |
$t1 = strtotime($a['date']); | |
$t2 = strtotime($b['date']); | |
return $t1 - $t2; | |
} |
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 | |
/** | |
* Print a datatype structure parsed for browser | |
* @param mixed $ar The datatype | |
*/ | |
if( !function_exists('ar_print') ){ | |
function ar_print( &$var ){ | |
//get variable name | |
foreach ($GLOBALS as $k => $v) |
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 | |
// Headings and rows | |
$headings = array('ID', 'Name', 'Colour'); | |
$array = array( | |
array(1, 'Apple', 'Green'), | |
array(2, 'Banana', 'Yellow'), | |
array(3, 'Orange', 'Orange'), | |
); |
OlderNewer