Skip to content

Instantly share code, notes, and snippets.

View ahmedsayedabdelsalam's full-sized avatar

Ahmed Sayed ahmedsayedabdelsalam

View GitHub Profile
#!/usr/bin/env php
<?php
function base64UrlEncode($text)
{
return str_replace(
['+', '/', '='],
['-', '_', ''],
base64_encode($text)
);
@ahmedsayedabdelsalam
ahmedsayedabdelsalam / psync
Created February 4, 2022 20:51
command to sync your repos between devices
#!/bin/sh
#####################
##### VARIABLES #####
#####################
SITES_PATH=$SITES
SYNC_REPO='[email protected]:ahmedsayedabdelsalam/project-sync.git'
ORIGIN_NAME='sync'
VERSION='0.1.0'
@ahmedsayedabdelsalam
ahmedsayedabdelsalam / localazy.json
Last active August 8, 2023 08:05
laravel localazy
{
"upload": {
"files": [
{
"type": "php",
"pattern": "lang/en/**.php"
},
{
"group": "existing",
"type": "php",
@ahmedsayedabdelsalam
ahmedsayedabdelsalam / set-tenant-header.js
Last active August 16, 2023 17:44
tenancy-livewire
export default function(tenant, headerKey = 'X-Tenant') {
handleLivewireCalls(tenant, headerKey)
handleFetchCalls(tenant, headerKey)
handleXMLHttpCalls(tenant, headerKey)
handleAxiosCalls(tenant, headerKey)
}
function handleLivewireCalls(tenant, headerKey) {
if (! window.Livewire) return;