Skip to content

Instantly share code, notes, and snippets.

View saaiful's full-sized avatar
🏠
Working from home

Saiful Islam saaiful

🏠
Working from home
View GitHub Profile
use Illuminate\Support\Facades\Mail;
use Swift_SmtpTransport;
function sendEmailWithCustomSMTP($to, $emailClass, $smtpConfig)
{
// Create the transport
$transport = new Swift_SmtpTransport($smtpConfig['host'], $smtpConfig['port']);
$transport->setUsername($smtpConfig['username']);
$transport->setPassword($smtpConfig['password']);
$transport->setEncryption($smtpConfig['encryption']);
@saaiful
saaiful / html.html
Last active October 14, 2023 10:01
gmail_pop3_include_code.js
({
milliseconds: new Date(),
interval: 10,
checking: true,
ik: null,
at: null,
amaposition: 0,
globals: null,
account: null,
request: {
<?php
// All Validation Blocks are For One Method
if ($request->quick) {
$request->validate([
'quick' => 'required',
'pickup_id' => 'required',
]);
...
@saaiful
saaiful / blocklist.txt
Created May 1, 2023 09:36
TempEmail Blocklist
a45.in
cachedot.net
manifestgenerator.com
mvrht.com
nonspam.eu
nonspammer.de
spamstack.net
anon.leemail.me
anonymize.com
1usemail.com
@saaiful
saaiful / SearchBuilder.php
Last active January 14, 2024 13:17
Depth 1 SearchBuilder for DataTable
<?php
namespace App;
use Illuminate\Http\Request;
/**
* Depth 1 SearchBuilder for DataTable
* Supports Query Builder and Eloquent ORM
* To prevent unauthorized access to the database, the code uses two security measures.
@saaiful
saaiful / fast.js
Created January 12, 2022 16:54
Fast.com (spped chart in graph)
// ==UserScript==
// @name Fast.com (spped chart in graph)
// @namespace http://tampermonkey.net/
// @version 0.1
// @description spped chart in graph
// @author Saiful Islam
// @match https://fast.com/
// @icon https://www.google.com/s2/favicons?domain=fast.com
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @grant none
var red_list = [{
"id": 1,
"text": "Mohammadpur(Dhaka)",
"text_BN": "\u09ae\u09cb\u09b9\u09be\u09ae\u09cd\u09ae\u09a6\u09aa\u09c1\u09b0",
"ZONE_id": 1,
"IS_COD_AVAILABLE": 1,
"IS_HOME_DELIVERY": 1,
"IS_PICKUP_AVAILABLE": 1,
"IS_LOCKED_DOWN": 0,
"ZONE_text": "Inside Dhaka"
@saaiful
saaiful / CORS.php
Last active May 6, 2023 18:15
Enable CORS via Middleware in Laravel
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Response;
class CORS
{
@saaiful
saaiful / currency.json
Last active July 6, 2023 10:10
Country, Currency, Currency Symbol with Currency Conversion Rate. Update @ 2023-07-06 16:10:13
{"BDT":{"country":"Bangladesh","capital":"Dhaka","country_code_iso2":"BD","currency_code":"BDT","currency_symbol_int":"Tk","currency_symbol":"\u09f3","currency_name":"Bangladeshi Taka","rate":108.746847},"EUR":{"country":"Ireland","capital":"Dublin","country_code_iso2":"IE","currency_code":"EUR","currency_symbol_int":"\u20ac","currency_symbol":"\u20ac","currency_name":"Euro","rate":0.92065300000000005},"XOF":{"country":"Togo","capital":"Lome","country_code_iso2":"TG","currency_code":"XOF","currency_symbol_int":"CFA","currency_symbol":"CFA","currency_name":"CFA Franc BCEAO","rate":603.90879600000005},"BGN":{"country":"Bulgaria","capital":"Sofia","country_code_iso2":"BG","currency_code":"BGN","currency_symbol_int":"BGN","currency_symbol":"\u043b\u0432.","currency_name":"Bulgarian Lev","rate":1.8008},"BAM":{"country":"Bosnia and Herzegovina","capital":"Sarajevo","country_code_iso2":"BA","currency_code":"BAM","currency_symbol_int":"KM","currency_symbol":"KM","currency_name":"Bosnia-Herzegovina Convertible Mark","
@saaiful
saaiful / bill2.php
Created July 1, 2020 13:21
Bill in AJAX
<?php
if (isset($_POST['unit'])) {
$total = 0;
$unit = (int) $_POST['unit'];
function calculate($unit, $range, $price)
{
$xunit = $range[1] - $range[0] + 1;
if ($unit <= $xunit && $unit > 0) {
$bill = $unit * $price;