- PHP >7.2
- Composer
- Python3
- numpy
- cupy (optional)
- PIL
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
interface Test { | |
/** | |
* Provide a string and I will give you a boolean | |
* | |
* @example | |
* concrete.myFunc('str'); // false | |
*/ | |
myFunc (a: string) : boolean; | |
/** |
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
<?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
<?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
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]; |
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
//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
function is_leap($year = NULL) { | |
return checkdate(2, 29, ($year == NULL)? date('Y'):$year); // true if is a leap year | |
} |
NewerOlder