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
public function formatBody($value){ | |
// The Regular Expression filter | |
$reg_exUrl = '#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#'; | |
return Str::of($value)->replaceMatches($reg_exUrl, function ($match) { | |
$parsedUrl = parse_url($match[0]); | |
if (($parsedUrl['host'] == 'youtube.com' || $parsedUrl['host'] == 'www.youtube.com') && isset($parsedUrl['query'])) { | |
parse_str($parsedUrl['query'], $key); |
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
docker ps - to show running containers | |
docker ps -a -- to show all containers | |
docker images - to show images | |
Pull an image: | |
-------------- | |
docker pull <image>:<tag> | |
docker pull postgres:14-alpine - pull postgres image |
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
Open httpd.conf and change Listen 80 to Listen 8080 | |
Mysql: | |
Change the php.ini and my.ini port 3306 to 3307 | |
Restart the xampp, if not work restard the pc also. |
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
birthday = '1987-05-04'; | |
age = ((Date.now() - Date.parse(birthday)) / 31557600000).toFixed(1); | |
alert(age); |
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
UPDATE table SET domain = LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM(name), ':', ''), '’', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) |
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 uniqueNumber(){ | |
$unqNo = strtotime(date("Ymdhis"))*999; | |
return $unqNo; | |
} |
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 | |
// Load the logo stamp and the photo to apply the watermark to | |
$logo = imagecreatefrompng('https://cdn.jagonews24.com/media/common/og-logo.png'); | |
//$logo = imagecolorallocate($logo,0,0,0); | |
$img = imagecreatefromjpeg('https://cdn.jagonews24.com/media/imgAll/2018June/shahin-cover-20180711084009.jpg'); | |
// Set the margins for the stamp and get the height/width of the stamp image | |
$marge_right = 10; | |
$marge_bottom = 10; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Fan Club List</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
</head> |
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 | |
//To start using reCAPTCHA, you need to sign up for an API key pair for your site from https://www.google.com/recaptcha/admin#list | |
$siteKey = "6LcqlUAUAAAAAFqZqFzhtEHApepRVPtv-Xynkub9"; | |
$secretKey = "6LcqlUAUAAAAADt1b9okVcSrgC0461J9NyTzNqlY"; | |
$gres = $_POST['g-recaptcha-response']; | |
$ip = $_SERVER['REMOTE_ADDR']; | |
$suc = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secretKey.'&response='.$gres.'&remoteip='.$ip); | |
$res = json_decode($suc); |
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
$this->validate($request, [ | |
'heading' => 'required', | |
'category' => 'required', | |
'details' => 'required', | |
],[ | |
'heading.required' => 'লেখার শিরোনাম প্রদান করুন!', | |
'category.required' => 'একটি ক্যাটাগরি নির্বাচন করুন!', | |
'details.required' => 'বিস্তারিত লেখা প্রদান করুন!', | |
]); |
NewerOlder