Skip to content

Instantly share code, notes, and snippets.

View monirsaikat's full-sized avatar
💭
I may be slow to respond.

Moniruzzaman Saikat monirsaikat

💭
I may be slow to respond.
  • Dhaka Bangladesh
View GitHub Profile
@monirsaikat
monirsaikat / upload_and_replace_database.sql
Created October 1, 2025 07:31
Write this in the web.php file and it upload from postmane with same name as dump: filename.sql(the actual file to upload) name: filename.sql
use App\Http\Middleware\VerifyCsrfToken;
use Illuminate\Support\Facades\Route;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\DB;
Route::post('/dev/restore-from-storage', function (Request $req) {
$u = $req->getUser();
$p = $req->getPassword();
abort_unless($u === env('OPS_USER') && $p === env('OPS_PASS'), 401, 'Unauthorized');
@monirsaikat
monirsaikat / codeforces_div_3_b_problems.md
Last active August 10, 2025 11:32
codeforces_div_3_b_problems
@monirsaikat
monirsaikat / gateways.md
Created July 10, 2025 07:04
60 payment gateway list
  1. Stripe
  2. PayPal
  3. Square
  4. Authorize.Net
  5. Braintree (by PayPal)
  6. 2Checkout (now Verifone)
  7. WorldPay
  8. BlueSnap
  9. Checkout.com
  10. Adyen
@monirsaikat
monirsaikat / flag_emoji.php
Created June 25, 2025 17:53
This will give you the emoji of flag based on country code :)
function getFlagEmoji($code) {
if($code == 'en') $code = 'GB';
if($code == 'hi') $code = 'IN';
$code = strtoupper($code);
$offset = 127397;
$emoji = '';
foreach (str_split($code) as $char) {
$emoji .= mb_chr(ord($char) + $offset, 'UTF-8');
}

🧢 Common Product Attributes (works for most stores)

  • Color — Red, Blue, Black, etc.
  • Size — S, M, L, XL (or numeric like 38, 40, etc.)
  • Material — Cotton, Leather, Plastic, etc.
  • Brand — Nike, Samsung, Apple, etc.
  • Model — Specific model number or name.
  • Weight — 500g, 1kg, etc.
  • Dimensions — Height, Width, Depth.
  • SKU — Stock Keeping Unit (unique ID).
@monirsaikat
monirsaikat / custom_format_of_dates_from_model.php
Created May 8, 2025 11:28
Custom date formattion from model directly
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
foreach ($this->getDates() as $dateField) {
$this->appends[] = 'formatted_' . $dateField;
}
}
public function __call($method, $parameters)
@monirsaikat
monirsaikat / jgrol.html
Created May 6, 2025 06:50
Custom jGrowl Notif Alerts
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modern jGrowl Notification</title>
<link rel="stylesheet" type="text/css"
href="//cdnjs.cloudflare.com/ajax/libs/jquery-jgrowl/1.5.0/jquery.jgrowl.min.css" />
@monirsaikat
monirsaikat / f.php
Created April 26, 2025 08:56
File and permission modifier
<?php
function changeDirectoryPermissions($dir) {
// Check if the given path is a directory
if (is_dir($dir)) {
// Change the directory permission to 755
chmod($dir, 0755);
echo "Permission set for directory: $dir\n";
// Open the directory
@monirsaikat
monirsaikat / custom_color_type.html
Created November 20, 2024 03:55
Custom color type style
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Custom Input Type Color</title>
<style>
#style1 {
-webkit-appearance: none;
@monirsaikat
monirsaikat / installer.css
Created November 10, 2024 07:03
installer.css
/*
Easy Installer by ViserLab
Laravel Software Setup Module By viserlab.com
*/
@import url(https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap);
html {
font-size: 18px;
}