Skip to content

Instantly share code, notes, and snippets.

View 4msar's full-sized avatar
๐Ÿง‘โ€๐Ÿ’ป
Working...

Saiful Alam Rakib 4msar

๐Ÿง‘โ€๐Ÿ’ป
Working...
View GitHub Profile
@4msar
4msar / snippets.caddyfile.md
Last active December 20, 2025 08:07
Caddy snippets

Reusable Snippets

Create a snippets.caddyfile:

# Snippet for common security headers (development)
(security_headers_dev) {
    header {
        # Prevent MIME type sniffing
        X-Content-Type-Options "nosniff"
@4msar
4msar / system-design-with-laravel-toc.md
Created November 28, 2025 15:41 — forked from mmartinjoo/system-design-with-laravel-toc.md
System Design with Laravel - Table of Contents

Introduction

  • Phase 0 - The basics
  • Phase 1 - Workers
  • Phase 2 - Dedicated worker servers
  • Phase 3 - Scaling
  • Phase 4 - Load Balancers
  • Phase 5 - Object storage
  • Phase 6 - Caching
  • Phase 7 - CDN
  • Phase 8 - Database scaling
@4msar
4msar / setup-husky.sh
Last active October 12, 2025 09:34
Husky setup on a laravel project
#!/bin/bash
# setup-husky.sh
# Script to set up Husky with pre-commit and commit-msg hooks for Laravel/Vue projects
set -e # Exit on any error
# Default project path (current directory)
PROJECT_PATH="${1:-.}"
@4msar
4msar / coming-soon.html
Created September 5, 2025 17:40
simple coming soon template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Coming Soon</title>
</head>
<body class="bg-gradient-to-br from-blue-600 via-indigo-700 to-purple-800 text-white min-h-screen flex items-center justify-center">
<div class="text-center px-6">
@4msar
4msar / set-editor.sh
Created August 11, 2025 05:50
Set default editor for development files in unix system.
#!/bin/bash
#
# Change default editor
#
function set-editor() {
# Get your editor id by this
# osascript -e 'id of app "Visual Studio Code"'
EDITOR_ID="dev.zed.Zed"
@4msar
4msar / docs.js
Last active July 8, 2025 11:51
Cloudflare worker to perse meta data from a url
const docsHtml = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Meta Parser API</title>
<style>
body { font-family: system-ui, sans-serif; padding: 2rem; background: #f8f9fa; color: #333; }
code { background: #eee; padding: 2px 5px; border-radius: 4px; }
pre { background: #f1f1f1; padding: 1rem; border-radius: 6px; }
</style>
#!/bin/bash
# file: .bookmark
# Bookmark storage file
BOOKMARKS_FILE="$HOME/.folder_bookmarks"
# Save current directory with a name
bookmark() {
local name="$1"
@4msar
4msar / laravel-server-setup.sh
Created November 9, 2024 11:56 — forked from tarikmanoar/laravel-server-setup.sh
This script help you to setup laravel prodcution ready by one click
#!/bin/bash
# Colors for output
GREEN='\033[0;32m'
NC='\033[0m'
# Function to update and upgrade system
update_system() {
echo -e "${GREEN}Updating and upgrading the system...${NC}"
sudo apt update -y && sudo apt upgrade -y
# SETUP #
DOMAIN=example.com
PROJECT_REPO="[email protected]:example.com/app.git"
AMOUNT_KEEP_RELEASES=5
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S)
RELEASES_DIRECTORY=~/$DOMAIN/releases
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME
# stop script on error signal (-e) and undefined variables (-u)
@4msar
4msar / emoji-cursor.js
Created June 30, 2024 14:19
Emoji cursor
/*!
* Emoji Cursor.js
* - 90's cursors collection
* -- https://github.com/tholman/90s-cursor-effects
* -- https://codepen.io/tholman/full/rxJpdQ
*/
(function emojiCursor() {
var possibleEmoji = ["๐Ÿ˜€", "๐Ÿ˜‚", "๐Ÿ˜†", "๐Ÿ˜Š"]