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 | |
/** | |
* Recursively iterates over $var, displaying each | |
* property/variable contained within | |
* @param mixed $var Variable of any type | |
* @param boolean $displayTypes Whether to display the types along with values | |
* @param integer $depth private var for telling how deep we are | |
* @return null always returns null | |
*/ |
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 | |
$search = "/( +)((abstract|final)? ?(public|private)? ?(static)?function [^\(]+([^{\n])+)\n+? +?\{/i"; | |
$replace = "$1$2\n$1{"; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
<meta charset="utf-8"> | |
<title>Geocoding service</title> | |
<style> | |
html, body, #map-canvas { | |
height: 100%; | |
margin: 0px; |
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
<!-- styles for the timer --> | |
<style> | |
body{margin:0;padding:0}.manticorp-timing-container{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif}.manticorp-timing-container table{border-collapse:collapse;border:3px solid #555}.manticorp-timing-container tr:first-child td,.manticorp-timing-container tr:first-child th{text-align:center;border-bottom:2px solid #555} | |
.manticorp-timing-container tr:first-child:hover td,.manticorp-timing-container tr:first-child:hover th{background:#efefef}.manticorp-timing-container tr:hover td,.manticorp-timing-container tr:hover th{background:#ddd}.manticorp-timing-container td,.manticorp-timing-container th{padding:.4em 1em;-webkit-transition:background .06s;transition:background .06s;border-left:1px solid #555} | |
.manticorp-timing-container th{text-align:right;background:#efefef}.manticorp-timing-container .manticorp-timing-time{font-family:'Courier New',Courier,'Lucida Sans Typewriter','Lucida Typewriter',monospace} | |
.manticorp-timing-container .manticorp-timing-title{font-fam |
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 csv_to_array($filename='', $delimiter=',',$header = NULL) | |
{ | |
if(!file_exists($filename) || !is_readable($filename)) | |
return FALSE; | |
$data = array(); | |
if (($handle = fopen($filename, 'r')) !== FALSE) | |
{ | |
while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE) | |
{ |
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 is_leap($year = NULL) { | |
return checkdate(2, 29, ($year == NULL)? date('Y'):$year); // true if is a leap year | |
} |
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
//You can pass objects to partials, just pass them in an array: | |
$this->partial('mypartial.phtml', array('topic' => $topic')) | |
//The partial helper will take the keys of that array and create view vars out of them, so you can access it like this from within the partial: | |
<td><?= $this->topic->getDescription() ?></td> | |
//If you want to use objects with a partial loop, you can call setObjectKey() on the partialLoop helper and pass in an array of objects: |
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 str = $("#content").html(); | |
var search = /\/\**[\n\r*\*\w @(=}{",)]*\*\/[\r\n\t ]*private *\$(\w*)[ ="\w]*;/g; | |
$("#content").html(""); | |
var result = str.match(search); | |
var getFunc; | |
var setFunc; |
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
Plot = function (e) { | |
this.toCenter = function () { | |
d = Math.min(this.elm.width, this.elm.height); | |
mLR = Math.floor((document.documentElement.clientWidth - d) / 2); | |
mTB = Math.floor((document.documentElement.clientHeight - d) / 2); | |
this.setMargins(mTB, mLR, mTB, mLR); | |
this.position(Math.floor((document.documentElement.clientWidth - d) / 2), Math.floor((document.documentElement.clientHeight - d) / 2), true) | |
}; | |
this.setDimensions = function (x, y) { | |
y = this.checkVar(y, x, false); |
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
$url = "http://www.amazon.co.uk/dp/B003YGQP6A"; | |
preg_match('/\/([a-zA-Z0-9]{10})/',$url,$parsed); | |
$ASIN = $parsed[1]; |
OlderNewer