Skip to content

Instantly share code, notes, and snippets.

View moaalaa's full-sized avatar

Mohamed Alaa El-Din moaalaa

View GitHub Profile
@moaalaa
moaalaa / instructions.md
Created January 8, 2026 15:56
For powershell on windows

Powershell 7+

First we need Powershell V7 or above You can check your version with

$PSVersionTable.PSVersion

If following version or above appear you good to go

Major  Minor  Patch  PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
@moaalaa
moaalaa / table.php
Created January 3, 2026 17:25
Indexing Order and explaining
<?php
use App\Enums\DefaultStatus;
use App\Enums\OrganizationTypes;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{

Laravel + Soketi with SSL (cPanel and Apache)

This guide explains how to integrate Laravel with Soketi using secure WebSocket (WSS) over SSL via Apache. The key is to proxy wss:// connections through Apache with SSL termination, while Soketi itself runs unencrypted on localhost.


✅ Pre-requisites

  • Apache with mod_proxy, mod_proxy_http, mod_proxy_wstunnel, and mod_rewrite enabled.

  • Soketi server running and listening on port 6001.

Livewire.hook('commit', ({ succeed }) => {
succeed(() => {
Alpine.nextTick(() => $('#select').select2());
});
});
@moaalaa
moaalaa / HomeController.php
Created May 4, 2024 18:39
Add Form Fields to googe sheet using google App Scrpts
<?php
namespace App\Http\Controllers;
use Http;
class HomeController extends Controller
{
use UsingSEO;
@moaalaa
moaalaa / my-theme.omp.json
Created March 11, 2024 15:58
My Oh My Posh Theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 2,
"final_space": true,
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
@moaalaa
moaalaa / settings.json
Created March 7, 2024 12:06
Adding gitbash in windows terminal
{
"commandline": "C:\\Program Files\\Git\\bin\\bash.exe",
"guid": "{2cd05161-f869-4bbb-ad20-8ec1977fbdfe}",
"hidden": false,
"icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
"name": "Bash",
"startingDirectory": "E:\\work"
}
# To enable Install from "Anywhere" Source
sudo spctl --master-disable
/usr/local/bin/php /home/USERNAME/public_html/artisan schedule:run >> /dev/null 2>&1
@moaalaa
moaalaa / detect_visitor_patform.php
Created September 5, 2023 12:06
Detect Visitor Platform
<?php
function isAndroid()
{
if (isset($_SERVER['HTTP_USER_AGENT'])) {
return strpos($_SERVER['HTTP_USER_AGENT'], 'Android') ? true : false;
}
return false;