Skip to content

Instantly share code, notes, and snippets.

View Haythamasalama's full-sized avatar
Focusing... 🧘

Haytham A. Salama Haythamasalama

Focusing... 🧘
View GitHub Profile
@Haythamasalama
Haythamasalama / laravel-spa-authentication.md
Last active September 4, 2025 23:56
Setting Up Authentication for Laravel Single Page Applications (SPA)

Setting Up Authentication for Laravel Single Page Applications (SPA)

Suppose you have two websites that require authentication:

  1. localhost:8000 (backend)
  2. localhost:3000 (frontend)

Configuration Steps:

  1. Allow origins for https://localhost:3000/
@Haythamasalama
Haythamasalama / prettier.md
Last active April 23, 2023 22:06
Configuring Prettier pre-commit hook.

Installing and Configuring Prettier in Your Project

1. Install Pritter

npm install --save-dev --save-exact prettier

2. Create Prettier Configuration File

@Haythamasalama
Haythamasalama / pint.json
Last active April 27, 2025 09:24
PHP CS Fixer Rules - Laravel Pint
{
"preset": "laravel",
"rules": {
"array_indentation": true,
"array_syntax": {
"syntax": "short"
},
"binary_operator_spaces": {
"default": "single_space"
},
@Haythamasalama
Haythamasalama / createTopicsTelegram.js
Created August 18, 2023 17:44
Automated Telegram Topic Generation using JavaScript
const subjects = [
{
name: "Quizzes",
icon_custom_emoji_id: "5433614043006903194",
text: "Quizzes Topic",
},
// etc
];
const telegramToken = "";
const chatId = "";
@Haythamasalama
Haythamasalama / router.ts
Last active October 8, 2023 15:40
Auto-reload page when chunk assets are not found or failed to import in Vue.js
import { createRouter, createWebHistory } from 'vue-router';
import routes from '~pages';
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: routes,
});
router.onError((err) => {
@Haythamasalama
Haythamasalama / bus.md
Last active November 9, 2025 14:25
Bus Job

📦 Laravel Batch Transaction Processor

Simple Description: Asynchronous batch job processor for handling bulk transactions in Laravel using queues and real-time updates.

📝 What is this?

A Laravel-based system that processes large volumes of transactions asynchronously using queued batch jobs. It breaks down large transaction sets into smaller chunks, processes them in parallel, and provides real-time status updates.

📁 File Structure