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 / iterm2-solarized.md
Created January 6, 2024 18:07 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@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 / 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 / pint.json
Last active March 3, 2023 18:58
PHP CS Fixer Rules - Laravel Pint
{
"preset": "laravel",
"rules": {
"array_indentation": true,
"array_syntax": {
"syntax": "short"
},
"binary_operator_spaces": {
"default": "single_space"
},
@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 / laravel-spa-authentication.md
Last active June 26, 2024 18:24
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 / .php-cs-fixer.php
Created September 21, 2022 22:49 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',