Skip to content

Instantly share code, notes, and snippets.

View sumonst21's full-sized avatar

Md. Sumon Islam sumonst21

View GitHub Profile
# Cache node modules - speeds up future builds
cache:
paths:
- node_modules
stages:
- build
- run
variables:
@sumonst21
sumonst21 / whatissoslow.php
Created July 18, 2023 10:54 — forked from Viper007Bond/whatissoslow.php
WordPress: Times how long it takes each filter and action to run and displays results at the end of the page. Quick and dirty.
<?php
/**
* This little class records how long it takes each WordPress action or filter
* to execute which gives a good indicator of what hooks are being slow.
* You can then debug those hooks to see what hooked functions are causing problems.
*
* This class does NOT time the core WordPress code that is being run between hooks.
* You could use similar code to this that doesn't have an end processor to do that.
*
@sumonst21
sumonst21 / install_lamp_ubuntu.sh
Created July 4, 2023 11:14 — forked from ankurk91/install_lamp_ubuntu.sh
Ubuntu 22 - PHP development (php 7.4 / 8.2, apache 2.4)
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Ubuntu 20/22 dev Server
# Run like (without sudo) - bash install_lamp.sh
# Script should auto terminate on errors
export DEBIAN_FRONTEND=noninteractive
@sumonst21
sumonst21 / Remove YT Shorts | AdGuard.md
Created June 23, 2023 09:48
Remove YT Shorts | AdGuard

https://www.reddit.com/r/uBlockOrigin/wiki/solutions/youtube/#wiki_shorts

! YT Homepage - Hide the Shorts section
youtube.com##[is-shorts]
! YT Menu - Hide the Shorts button
www.youtube.com###guide [title="Shorts"], .ytd-mini-guide-entry-renderer[title="Shorts"]
! YT Search - Hide Shorts
www.youtube.com##ytd-search ytd-video-renderer [overlay-style="SHORTS"]:upward(ytd-video-renderer)
! YT Search and Channels - Hide the Shorts sections
www.youtube.com##ytd-reel-shelf-renderer
@sumonst21
sumonst21 / fb_activity_by_keyword.py
Created May 13, 2023 19:47
For my little brother
import facebook
import requests
import json
import os
# Your access token
#access_token = '<your-access-token>'
access_token = os.environ.get('FACEBOOK_ACCESS_TOKEN')
# The Facebook API endpoint to get your posts
api_endpoint = f'https://graph.facebook.com/v16.0/me?fields=id,name,posts&access_token={access_token}'
@sumonst21
sumonst21 / osm_reverse_geocoding.php
Created April 2, 2023 23:36
osm reverse geocoding
<?php
/**
* osm reverse geocoding
* https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=52.5487429714954&lon=-1.81602098644987&zoom=18&addressdetails=1
*
* @param string|float $lat
* @param string|float $long
* @return array
* @throws Exception
* @see https://wiki.openstreetmap.org/wiki/Nominatim
@sumonst21
sumonst21 / validateAddress.php
Created April 2, 2023 23:34
Validate address using OpenStreetMap
<?php
/**
* Validate address using OpenStreetMap
*
* @param string $street
* @param string $house_no
* @param string $city
* @param string $zip
* @param string $state
* @param string $country
@sumonst21
sumonst21 / start_ngrok_telegram_bot.sh
Created March 18, 2023 13:44 — forked from obokaman-com/start_ngrok_telegram_bot.sh
A bash script to start Ngrok in background, and send ngrok URL to a Telegram Bot automatically, copying the remote URL to clipboard
#!/usr/bin/env bash
# Start NGROK in background
echo "⚡️ Starting ngrok"
ngrok http 8080 > /dev/null &
# Wait for ngrok to be available
while ! nc -z localhost 4040; do
sleep 1/5 # wait Ngrok to be available
done
@sumonst21
sumonst21 / lamp-ubuntu16.sh
Created March 5, 2023 14:20 — forked from lyquix-owner/lamp-ubuntu16.sh
Bash script to setup LAMP server on Ubuntu 16.04
#!/bin/bash
# Check if script is being run by root
if [[ $EUID -ne 0 ]]; then
printf "This script must be run as root!\n"
exit 1
fi
DIVIDER="\n***************************************\n\n"
@sumonst21
sumonst21 / HighlightTextInPDF_NodeJs.md
Created February 24, 2023 22:20 — forked from groupdocs-cloud-gists/HighlightTextInPDF_NodeJs.md
Highlight Text in PDF using REST API in Node.js