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
function loadLatestContent() {
// Define the target element where the content will be rendered
const $targetElement = $('.desktopSectionListMedia.listItemLastBB0');
// Fetch the latest content from the server
$.ajax({
url: '/ajax/latest',
method: 'GET',
dataType: 'json', // Expecting a JSON response
success: function(data) {
@saaiful
saaiful / server_update.sh
Created August 11, 2024 19:33
server_update.sh
#!/bin/bash
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/package/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/openresty.list > /dev/null
sudo apt-get update
sudo apt-get -y install openresty
rm /usr/local/openresty/nginx/modules/ngx_http_geoip2_module.so
openresty=$(openresty -v 2>&1|cut -d "/" -f2)
# Download the OpenResty source code
wget https://openresty.org/download/openresty-$openresty.tar.gz
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 May 9, 2024 00:29
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
{