Skip to content

Instantly share code, notes, and snippets.

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

Md. Sumon Islam sumonst21

🏠
Working from home
View GitHub Profile
@sumonst21
sumonst21 / index.html
Created February 8, 2023 10:41 — forked from maxkostinevich/index.html
Cloudflare Worker - Handle Contact Form
<!--
/*
* Serverless contact form handler for Cloudflare Workers.
* Emails are sent via Mailgun.
*
* Learn more at https://maxkostinevich.com/blog/serverless-contact-form
* Live demo: https://codesandbox.io/s/serverless-contact-form-example-x0neb
*
* (c) Max Kostinevich / https://maxkostinevich.com
*/
@sumonst21
sumonst21 / get_real_ip_cloudflare.php
Created February 3, 2023 04:03 — forked from lenivene/get_real_ip_cloudflare.php
Get REAL IP in CloudFlare by PHP
<?php
function get_ip(){
if( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ){
$ip = $_SERVER['HTTP_CLIENT_IP'];
}
elseif( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ){
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else{
$ip = $_SERVER['REMOTE_ADDR'];
@sumonst21
sumonst21 / google-img-resize.mdown
Created January 6, 2023 09:30
Google’s authentication-less on-the-fly image resizing service

Google's authentication-less on-the-fly image resizing service

I found it while poking around the Google+ HTML. Jotting down some notes felt like a good idea, so here goes. If you know more about this API, let me know, please!

(Word of warning: I spent ~30 minutes on both my experimentation and this here write-up, so it might not be the most thought-provoking, brilliant thing you read today.)

@sumonst21
sumonst21 / deployment_guide.md
Created January 5, 2023 01:43 — forked from vicgonvt/deployment_guide.md
Deployment Guide for Ubuntu Server from Scratch with Laravel
@sumonst21
sumonst21 / github_desktop_ubuntu.sh
Created November 26, 2022 22:01 — forked from berkorbay/github_desktop_ubuntu.md
To install Github Desktop for Ubuntu
## Follow this link for further updates to Github Desktop for Ubuntu https://github.com/shiftkey/desktop/releases/latest
# UPDATE (2022-11-07): Thanks to Sxvxgee's message, the updated code is as follows
sudo wget https://github.com/shiftkey/desktop/releases/download/release-3.1.1-linux1/GitHubDesktop-linux-3.1.1-linux1.deb
### Uncomment below line if you have not installed gdebi-core before
# sudo apt-get install gdebi-core
sudo gdebi GitHubDesktop-linux-3.1.1-linux1.deb
# UPDATE (2021-10-18): Thanks to Amin Yahyaabadi's message, the updated code is as follows
@sumonst21
sumonst21 / my.cnf
Created November 24, 2022 02:26 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@sumonst21
sumonst21 / setup-percona-server.sh
Created November 23, 2022 23:56 — forked from till/setup-percona-server.sh
A small shell script to install percona-server (and -client).
#!/bin/sh
############################
# Author: Till Klampaeckel #
# License: New BSD License #
############################
version=$1
if [ "x$version" = "x" ]; then
echo "Usage: ./$0 5.0|5.1"
@sumonst21
sumonst21 / plex-meta-resize.php
Created October 18, 2022 00:12 — forked from Fursje/plex-meta-resize.php
Resize plex metadata images
<?php
$a = new img_resize();
$a->run();
class img_resize {
public $img_files = array();
public $img_path = "";
public $bad_files = array();
@sumonst21
sumonst21 / build-tools.md
Created October 15, 2022 00:47 — forked from callumacrae/build-tools.md
Build tools written in JavaScript
# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------
# These are pretty far-future expires headers.
# They assume you control versioning with filename-based cache busting
# Additionally, consider that outdated proxies may miscache
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# If you don't use filenames to version, lower the CSS and JS to something like