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 / .gitlab-ci.yml
Created August 1, 2023 21:38 — forked from MexsonFernandes/.gitlab-ci.yml
Gitlab pipeline deploy app on AWS Beanstalk
stages:
- build
- deploy
variables:
S3_BUCKET: "bucket"
S3_ARCHIVE_PATH_PROD: "production/"
build:
image: docker:latest
@sumonst21
sumonst21 / docker-ubuntu-1804.sh
Created August 1, 2023 21:38 — forked from MexsonFernandes/docker-ubuntu-1804.sh
Install Docker on Ubuntu 18.04 (without sudo mode docker cli setup)
#!/bin/bash
echo "Updating system..."
sudo apt update
echo "Installing dependencies..."
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
echo "Downloading data..."
sudo apt install -y curl
AWSTemplateFormatVersion: "2010-09-09"
Description: "Template description"
Parameters:
AppEnvironment:
Type: String
Default: production
EC2InstanceType:
Type: String
Default: a1.medium
# 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 / cloudflare_fetch_rayid_log.sh
Created September 23, 2022 22:29 — forked from mihaitodor/cloudflare_fetch_rayid_log.sh
Fetch Cloudflare log data for a given Ray ID
#!/bin/bash
# Fetch Cloudflare log data for a given Ray ID
# Please note that the Ray ID is the first part of `CF-RAY` (4a807f60ca5727a4-FRA -> 4a807f60ca5727a4)
CF_ZONE=${1}
RAY_ID=${2}
if ! host -N 0 "${CF_ZONE}" 2>&1 > /dev/null; then
echo "Invalid domain '${CF_ZONE}'"
@sumonst21
sumonst21 / laravel-ci-cd-workflow.yml
Created February 23, 2023 09:37 — forked from JustinByrne/laravel-ci-cd-workflow.yml
Github Action to test laravel and then compile the assets to a production branch
name: CI/CD workflow
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
testing:
@sumonst21
sumonst21 / index.html
Created August 30, 2021 00:20
Select Field with Search - AlpineJs + Tailwind
<div class="flex flex-col items-center">
<div class="w-full md:w-1/2 flex flex-col items-center h-64">
<div class="w-full px-4">
<div x-data="selectConfigs()" x-init="fetchOptions()" class="flex flex-col items-center relative">
<div class="w-full">
<div @click.away="close()" class="my-2 p-1 bg-white flex border border-gray-200 rounded">
<input
x-model="filter"
x-transition:leave="transition ease-in duration-100"
x-transition:leave-start="opacity-100"
@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}'