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\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Support\Facades\Storage; | |
use Intervention\Image\Facades\Image; | |
class EncodeToWebp extends Command | |
{ |
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 | |
// Configuration | |
$token = '123:abc'; | |
$adminId = 123456; | |
$webhookSecret = 'random-long-text'; | |
// Security | |
if ($_SERVER['REQUEST_METHOD'] !== 'POST') |
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
{ | |
"***": "اصفهان", | |
"169": "آذرشهر", | |
"170": "اسکو", | |
"149": "اهر", | |
"171": "بستان آباد", | |
"168": "بناب", | |
"136": "تبریز", | |
"545": "ترکمانچای", | |
"505": "جلفا", |
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 | |
$botToken = 'x'; | |
$chatId = 1234; | |
$dontIncludeHeadersName = 'nh'; | |
$separator = PHP_EOL; | |
$twoSeparator = $separator . $separator; | |
function bot($method, $data = null) { | |
global $botToken; |
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/bin/env bash | |
Domain='example.com' # root domain | |
Name='' | |
G='\033[0;32m' | |
N='\033[0m' | |
while [[ -z ${Name} ]]; do | |
echo "Enter Subdomain: (for example api)" | |
read Name |
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 | |
/** | |
* @param string $data The data to encode. Data can be digits (0-9), alphanumeric characters, binary bytes of data, or Kanji. You cannot mix data types within a QR code. Note that URLs have a 2K maximum length, so if you want to encode more than 2K bytes (minus the other URL characters). | |
* @param int $width | |
* @param int $height | |
* @param int $margin The width of the white border around the data portion of the code. This is in rows, not in pixels. | |
* @param string $errorCorrection QR codes support four levels of error correction to enable recovery of missing, misread, or obscured data. Greater redundancy is achieved at the cost of being able to store less data. The supported values: L (Allows recovery of up to 7% data loss) | M (15%) | Q (25%) | H (30%) | |
* @param string $encoding How to encode the data in the QR code. The available values: UTF-8 | Shift_JIS | ISO-8859-1 | |
* @return string URL of the QR code. | |
*/ |
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 Transfer($file, $name = null, $maxDownloads = null, $maxDays = null) { | |
$naf = false; | |
// If file doesn't exist, create a file with the $file content | |
if (!is_file($file)) { | |
$naf = true; | |
$cFile = !empty($name) ? $name : "Transfer-" . rand(1111, 9999) . ".tmp"; | |
file_put_contents($cFile, $file); | |
$file = $cFile; | |
} |
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 digikalaProduct($PID) { | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://api.digikala.com/v1/product/$PID/"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.81 Safari/537.36"); | |
$output = curl_exec($ch); | |
curl_close($ch); | |
return $output; |
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 ZarinpalMessage($statusCode) { | |
$message = "تشخیص خطا امکان پذیر نبود"; | |
switch ($statusCode) { | |
case -1: | |
$message = "اطلاعات ارسال شده ناقص است"; | |
break; | |
case -2: | |
$message = "آیپی یا مرچنت کد صحیح نیست"; | |
break; |