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
alias .='xdg-open .' | |
alias 2='/var/www/html' | |
alias c=clear | |
alias comda='composer dump-autoload' | |
alias comi='composer install' | |
alias comu='composer update' | |
alias nrd='npm run dev' | |
alias nrw='npm run watch' | |
alias pa='php artisan' | |
alias pacc='php artisan cache:clear' |
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 | |
if (!function_exists('classActivePath')) { | |
function classActivePath($segment, $value) | |
{ | |
if(!is_array($value)) { | |
return Request::segment($segment) == $value ? ' menu-open' : ''; | |
} | |
foreach ($value as $v) { | |
if(Request::segment($segment) == $v) return ' menu-open'; | |
} |
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
{"lastUpload":"2020-09-15T00:58:07.652Z","extensionVersion":"v3.4.3"} |
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 this to ~/.ideavimrc file to switch to normal mode with (jj) key bindings | |
imap jj <Esc> | |
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 |
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
<?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
// 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
#! /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
<?php | |
namespace App\Http\Traits; | |
use Illuminate\Http\JsonResponse; | |
use Illuminate\Http\Resources\Json\JsonResource; | |
trait ApiResponder | |
{ | |
/** |
OlderNewer