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 App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Route; | |
class CheckUserPermissions |
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 App\Services; | |
use Kreait\Firebase\Factory; | |
use Google\Cloud\Firestore\FieldValue; | |
use Throwable; | |
class FirestoreNotificationService | |
{ |
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 App\Services; | |
use Stripe\StripeClient; | |
use App\Exceptions\StripeApiException; | |
use App\Models\User; | |
use App\Models\UserCard; | |
use Throwable; |
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 App\Services; | |
use Kreait\Firebase\Factory; | |
use App\Jobs\ProcessEmail; | |
use App\Exceptions\InvalidIdTokenException; | |
use App\Exceptions\UserAlreadyRegisteredException; | |
use App\Exceptions\UserBlockedException; | |
use App\Exceptions\AccessForbiddenException; |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Payment Form</title> | |
<!-- Include Stripe.js --> | |
<script src="https://js.stripe.com/v3/"></script> | |
</head> |
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 hasFocus(element) { | |
return element.contains(document.activeElement); | |
} |
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 | |
use Illuminate\Support\Str; | |
function save_base64_to_webp( | |
$string, | |
$file_directory, | |
$file_name = null, | |
$disk_driver = 'local' | |
) |
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
import socket | |
def check_port(ip, port): | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.settimeout(1) | |
result = sock.connect_ex((ip, port)) | |
sock.close() | |
return result == 0 | |
def scan_ports(start_ip, end_ip, port): |
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 | |
check_in_distance($lat_a, $long_a, $lat_b, $long_b, $range) | |
{ | |
$dlat = ($lat_a / (180 / pi())) - ($lat_b / (180 / pi())); | |
$dlong = ($long_a / (180 / pi())) - ($long_b / (180 / pi())); | |
$c = pow(sin($dlat / 2), 2) + cos($lat_a); | |
$c = $c * cos($lat_b) * pow(sin($dlong / 2), 2); | |
$c = 2 * asin(sqrt($c)); | |
$c = 6371 * $c; |
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 | |
$tarFile = __DIR__ . '/file.tar'; | |
$extractTo = __DIR__ . '/'; | |
exec("tar -xf $tarFile -C $extractTo", $output, $returnCode); | |
if ($returnCode === 0) { | |
echo 'Extraction successful!'; | |
} else { |
NewerOlder