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 / file.sh
Created November 2, 2024 20:07
run brave browser without CORS in Ubuntu, Linux
// terminal command
brave-browser --disable-site-isolation-trials --disable-web-security --user-data-dir="~/tmp"
@MMTE
MMTE / index.tsx
Last active November 2, 2024 14:32
Render json object pretty in javascript ( react, vue , ... )
<pre>{JSON.stringify(data, null, 2)}</pre>
// https://stackoverflow.com/questions/30765163/pretty-printing-json-with-react
@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"
<?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
{