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 | |
function double(int $argument):int { | |
return $argument*2; | |
} | |
var_dump(double("2")); |
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 | |
function double(int $argument):int { | |
return $argument*2; | |
} | |
try { | |
var_dump(double([3])); | |
} catch (TypeError $e) { | |
echo "Caught as type error: ".$e->getMessage().PHP_EOL; | |
} |
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 | |
declare(strict_types=1); | |
function double(int $argument):int { | |
return $argument*2; | |
} | |
try { | |
var_dump(double("3")); | |
} catch (TypeError $e) { |
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
UPDATE `table` SET `somefield` = CONCAT(TRIM(TRAILING 'feryn.eu' FROM `name`),'thijs.be') WHERE 'otherField' = 'value' |
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
SELECT CONCAT(TRIM(TRAILING 'feryn.eu' FROM 'feryn.eu.bla.feryn.eu'),'thijs.be') |
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
vcl 4.0; | |
backend default { | |
.host = "10.10.10.53"; | |
.port = "80"; | |
} | |
sub vcl_recv { | |
set req.http.x-clientip = client.ip; | |
set req.http.x-serverip = server.ip; |
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 | |
echo "Client IP: " . $_SERVER["HTTP_X_CLIENTIP"]. "<br />".PHP_EOL; | |
echo "Server IP: " . $_SERVER["HTTP_X_SERVERIP"]. "<br />".PHP_EOL; | |
echo "Local IP: " . $_SERVER["HTTP_X_LOCALIP"]. "<br />".PHP_EOL; | |
echo "Remote IP: " . $_SERVER["HTTP_X_REMOTEIP"]. "<br />".PHP_EOL; | |
echo "X-Forwarded-For: " . $_SERVER["HTTP_X_FORWARDED_FOR"]. "<br />".PHP_EOL; |
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
global | |
daemon | |
defaults | |
mode http | |
frontend http-in | |
bind *:80 | |
default_backend servers | |
backend servers |
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/sbin/varnishd -a :6081 -a :6083,PROXY -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,5g |
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 | |
/** | |
* Integer division | |
*/ | |
var_dump( | |
intdiv(10, 3), | |
(10/3) | |
); |