Skip to content

Instantly share code, notes, and snippets.

View MMTE's full-sized avatar
🐢
Moving!

Mahdi Taleghani MMTE

🐢
Moving!
View GitHub Profile
@MMTE
MMTE / gist:a6a538e122eeab004598da087ff58806
Created October 14, 2023 21:32 — forked from BjornDCode/gist:5cb836a6b23638d6d02f5cb6ed59a04a
Tailwind - Fixed sidebar, scrollable content
// Source: https://twitter.com/calebporzio/status/1151876736931549185
<div class="flex">
<aside class="h-screen sticky top-0">
// Fixed Sidebar
</aside>
<main>
// Content
</main>
@MMTE
MMTE / port_killer.sh
Created September 18, 2023 03:36 — forked from ashishsrivastav22/port_killer.sh
Mac Port Killer
#!/usr/bin/env bash
echo -n "Enter Port Number."
read port
if [[ -n ${port//[0-9]/} ]]; then
echo "Invalid Port !!"
fi
lsof -i tcp:$port
@MMTE
MMTE / ddd_cqrs_event-sourcing_in_php.md
Created August 21, 2023 21:35 — forked from jsor/ddd_cqrs_event-sourcing_in_php.md
DDD, CQRS and Event Sourcing in PHP

DDD, CQRS and Event Sourcing in PHP

  • Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
  • EventCentric.Core - Event Sourcing and CQRS in PHP
  • LiteCQRS - Small convention based CQRS library for PHP
  • predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
  • ProophEventSourcing - Provides basic functionality for event-sourced aggregates
  • ProophEventStore - PHP 5.4+ EventStore Implementation
  • ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
@MMTE
MMTE / validate.php
Created January 26, 2023 19:25 — forked from cam-gists/validate.php
PHP: Regex Validation
<?php
// ref: http://komunitasweb.com/2009/03/10-practical-php-regular-expression-recipes/
// Validate Email
if (filter_var('[email protected]', FILTER_VALIDATE_EMAIL)) {
echo "Your email is ok.";
} else {
echo "Wrong email address format.";
}
//Validate Username
@MMTE
MMTE / docker-compose.yml
Created January 25, 2023 18:20 — forked from pyrou/docker-compose.yml
Use https://traefik.me SSL certificates for local HTTPS without having to touch your /etc/hosts or your certificate CA.
version: '3'
services:
traefik:
restart: unless-stopped
image: traefik:v2.0.2
ports:
- "80:80"
- "443:443"
labels:
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
@MMTE
MMTE / CaddyController.php
Created January 17, 2023 22:32 — forked from gilbitron/CaddyController.php
Enabling HTTPS (SSL) for Laravel Sail using Caddy
<?php
# app/Http/Controllers/CaddyController.php
namespace App\Http\Controllers;
use App\Store;
use Illuminate\Http\Request;
class CaddyController extends Controller
{
@MMTE
MMTE / laravel setup.sh
Created November 11, 2022 13:07 — forked from rolandstarke/laravel setup.sh
Server setup bash script for Laravel
# Ubuntu 20 LTS Server Setup for Laravel
# Login as root user
sudo su -
# Update list of available packages
apt update
@MMTE
MMTE / forge.sh
Created November 11, 2022 08:25 — forked from pLavrenov/forge.sh
Laravel Forge Setup Script (July 2020) - NGINX + MySQL
# Replace!
# [!server!] (the forge server instance)
# [!sudo_password!] (random password for sudo)
# [!db_password!] (random password for database user)
# [!user.name!] (git user name)
# [!user.email!] (git user email)
# [!server_ip!] (git user email)
#
# REQUIRES:
@MMTE
MMTE / forge.sh
Created November 11, 2022 08:16 — forked from azimidev/forge.sh
Laravel Forge Setup Script
#
# REQUIRES:
# - server (the forge server instance)
# - event (the forge event instance)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - callback (the callback URL)
#