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
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] |
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
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param QUERY_STRING $query_string; | |
fastcgi_param REQUEST_METHOD $request_method; | |
fastcgi_param CONTENT_TYPE $content_type; | |
fastcgi_param CONTENT_LENGTH $content_length; | |
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | |
fastcgi_param REQUEST_URI $request_uri; | |
fastcgi_param DOCUMENT_URI $document_uri; | |
fastcgi_param DOCUMENT_ROOT $document_root; |
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 | |
// Check if a redirect is needed | |
$redirect = !isset($_SERVER['HTTPS']) || ('on' != $_SERVER['HTTPS']); | |
$redirect = $redirect || !isset($_SERVER['HTTP_X_FORWARDED_PROTO']) || ('https' != $_SERVER['HTTP_X_FORWARDED_PROTO']); | |
// Permanent redirect to https version | |
if ($redirect) { | |
header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], true, 301); | |
exit(); | |
} |
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
# | |
# Connect to VM by VM Name via shh if user is not specified | |
# then try to connect using root user | |
# Examples: vboxssh root@CentOS7, vboxssh CentOS7 | |
# | |
function vboxssh { | |
USER= | |
if [[ "$1" == *@* ]]; then | |
# Get the user for ssh connection | |
USER=$(echo $1|cut -d@ -f1) || $(echo root) |
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
package main | |
import ( | |
"log" | |
"math" | |
) | |
func Round(val float64, roundOn float64, places int ) (newVal float64) { | |
var round float64 | |
pow := math.Pow(10, float64(places)) |
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/env bash | |
userdo= | |
echo Testing if you have root access! | |
if [[ 'root' == whoami ]]; then | |
is_root=true | |
else | |
is_root=false | |
fi |
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 | |
namespace Comparator; | |
use ReflectionObject; | |
use InvalidArgumentException; | |
class ObjectComparator | |
{ | |
/** |
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/env bash | |
declare -A radios | |
# Radio Pogreso | |
radios[RP]=XjfW7qWN | |
# Radio Rebelde | |
radios[RRe]=zrXXWK9F | |
# Radio Reloj | |
radios[RR]=b3jbfThq | |
# CMBF Radio Nacional Nacional | |
radios[CMBF]=Nbtz7HT3 |
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 returnStringOrNull($valueToReturn): ?string { | |
return $valueToReturn; | |
} | |
echo 'LibreByte:', gettype(returnStringOrNull('LibreByte')), nl2br("\n"); | |
echo 'null:', gettype(returnStringOrNull(null)), nl2br("\n"); | |
echo '25:', gettype(returnStringOrNull(25)), nl2br("\n"); | |
echo 'SdtClass object:', gettype(returnStringOrNull(new StdClass())), nl2br("\n"); |
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 | |
$countries = [ | |
['country' => 'Spain', 'lang' => 'ES', 'currency' => 'EUR'], | |
['country' => 'USA', 'lang' => 'EN', 'currency' => 'USD'] | |
]; | |
foreach ($countries as ['country' => $countryName, 'lang' => $language, 'currency' => $currency]) { | |
echo "<strong>Country: </strong> $countryName, <strong>Language: </strong> $language, <strong>Currency: </strong> $currency"; | |
echo nl2br("\n"); |