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 | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
class AcmeClient | |
{ | |
private $webDir; | |
private $domain; | |
private $accountEmail; |
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 | |
class Attachment | |
{ | |
private $allowedTypes = []; | |
private $allowedSize; // Size in MB | |
private $uploadPath; | |
private $fileName; | |
private $files; | |
private $errors = []; |
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
#!/bin/bash | |
# Ensure script is run as root | |
local INST_USER=$(id -u) | |
if [ $INST_USER != 0 ]; then | |
echoR "Sorry, only the root user can install." | |
echo | |
exit 1 | |
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 | |
require 'vendor/autoload.php'; // Include phpseclib | |
use phpseclib3\Net\SSH2; | |
class VPSSetup { | |
private $ssh; | |
private $domain; | |
private $email; | |
private $dbPassword; |
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
// QR Code Generator Library | |
class QRCode { | |
constructor(version = 1, errorCorrection = 'M') { | |
this.version = version; | |
this.errorCorrection = errorCorrection; | |
this.moduleCount = 21 + (version - 1) * 4; | |
this.modules = Array(this.moduleCount).fill().map(() => Array(this.moduleCount).fill(null)); | |
this.errorCorrectionLevels = { | |
'L': 0x01, // 7% error correction | |
'M': 0x00, // 15% error correction |
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
class SimpleSipUser { | |
constructor(options) { | |
this.options = { | |
aor: `sip:${options.username}@${options.domain}`, | |
maxSimultaneousSessions: 5, | |
media: { | |
constraints: { | |
audio: true, | |
video: false | |
} |
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 | |
private static function autoload() | |
{ | |
spl_autoload_register(function ($class) { | |
// Define base directories for known namespaces | |
$baseDirs = [ | |
'Framework\\Core\\' => FRAMEWORK_PATH . 'Core/', | |
'App\\' => APP_PATH | |
]; |
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 | |
class JWT { | |
private $secretKey; | |
public function __construct($secretKey) { | |
$this->secretKey = $secretKey; | |
} | |
public function generateToken($payload, $expiration = 3600) { |
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 | |
class WhatsappClass | |
{ | |
private $phoneNumberId; | |
private $accessToken; | |
private $url; | |
/** | |
* @param string $phoneNumberId |
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
function getLocalStorage() { | |
try { | |
return window.localStorage; | |
} catch (_) { | |
const store = {}; | |
return { | |
getItem(name) { | |
return store[name] || null; | |
}, | |
setItem(name, val) { |
NewerOlder