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('test+email@fexample.com', 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"
<?php
namespace App\Helpers;
class SMS
{
/**
* Gets API Ultra Fast Send Url.
*
@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
{
#!/bin/sh
curl https://www.arvancloud.ir/fa/ips.txt > ./r1c_ips.txt;
echo 'running......'
for x in `cat ./r1c_ips.txt`;
do
ufw allow from $x
done
ufw reload > /dev/null
@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