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
const getPerfs = () => { | |
let array = [] | |
const start = (window.performance || Date).now() | |
for (let i = 0; i < 20000; i++) { | |
array = Math.pow(Math.sin(Math.random()), 2) | |
} | |
const end = (window.performance || Date).now() | |
return end - start | |
} | |
if (timing < 7) PERF = PERF_HIGH |
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 | |
protected function calculateLoyaltyPoints($Loyalty_Points, $Loyalty_Participant): int | |
{ | |
if (!isset($Loyalty_Points->SN_Loyalty_Points)) { | |
return 0; | |
} | |
if (!$Loyalty_Participant) { | |
return 0; |
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 | |
namespace Curved\Health; | |
use Aws\CloudWatch\CloudWatchClient; | |
require __DIR__ . '/../vendor/autoload.php'; | |
class HealthInfo | |
{ |
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
# Backup container of mysql | |
docker run --rm --volumes-from my-mysql-container -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /var/lib/mysql | |
# Restore container of mysql | |
docker run --rm --volumes-from my-mysql-container -v $(pwd):/backup ubuntu bash -c "cd /var && tar xvf /backup/backup.tar --strip 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 | |
$username = "username"; | |
$password = "password"; | |
echo "Authorization: Basic " . base64_encode($username . ":" . $password); |
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
#!/bin/bash | |
if [ "$1" == "-h" ] || [ -z "$1" ]; then | |
echo "Usage: ./check_cert.sh domain.name" | |
exit 0 | |
fi | |
echo "DONE" | openssl s_client -showcerts -connect $1:443 |
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
[Unit] | |
Description=Caddy HTTP/2 web server | |
Documentation=https://caddyserver.com/docs | |
After=network-online.target | |
Wants=network-online.target systemd-networkd-wait-online.service | |
[Service] | |
Restart=on-failure | |
User=www-data |