This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"upload": { | |
"files": [ | |
{ | |
"type": "php", | |
"pattern": "lang/en/**.php" | |
}, | |
{ | |
"group": "existing", | |
"type": "php", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
##################### | |
##### VARIABLES ##### | |
##################### | |
SITES_PATH=$SITES | |
SYNC_REPO='[email protected]:ahmedsayedabdelsalam/project-sync.git' | |
ORIGIN_NAME='sync' | |
VERSION='0.1.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
function base64UrlEncode($text) | |
{ | |
return str_replace( | |
['+', '/', '='], | |
['-', '_', ''], | |
base64_encode($text) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Traits; | |
use Illuminate\Http\JsonResponse; | |
use Illuminate\Http\Resources\Json\JsonResource; | |
trait ApiResponder | |
{ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
##################################################### | |
echo "abdelsalam" >> file.txt | |
##################################################### | |
##################################################### | |
: ' | |
ahmed | |
sayed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// wiki for onboarding build with laravel | |
https://www.bookstackapp.com/ | |
// empty password for mysql | |
https://linuxconfig.org/mysql-allow-empty-password | |
// find matches | |
grep -r 'something' /path/to/file.txt | |
// replace inline in files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* we have a cart with coupon and we need to calculate the discount amount | |
* | |
* Note: | |
* - the coupon support multiple conditions | |
* - the included and excluded are optional | |
*/ | |
// Order Data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (querylog) surounds a block of code with laravel qurey log | |
// https://twitter.com/a7medsayed/status/1276724409974296577 | |
\DB::enableQueryLog(); | |
$SELECTION$ | |
\Log::info('query-log', [\DB::getQueryLog()]); | |
// (querycount) surounds a block of code with laravel qurey log count | |
\DB::enableQueryLog(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add the following command to ~/.zshrc to restore your zsh history inside phpstorm's terminal | |
export HISTFILE=$HOME/.zsh_history |
NewerOlder