Skip to content

Instantly share code, notes, and snippets.

View ahmedsayedabdelsalam's full-sized avatar

Ahmed Sayed ahmedsayedabdelsalam

View GitHub Profile
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'
<?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';
}
// add this to ~/.ideavimrc file to switch to normal mode with (jj) key bindings
imap jj <Esc>
// add the following command to ~/.zshrc to restore your zsh history inside phpstorm's terminal
export HISTFILE=$HOME/.zsh_history
@ahmedsayedabdelsalam
ahmedsayedabdelsalam / phpstorm_live_templates.txt
Last active June 27, 2020 05:46
phpstorm live templates
// (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();
@ahmedsayedabdelsalam
ahmedsayedabdelsalam / cloudSettings
Last active September 15, 2020 00:58
code95-vscode
{"lastUpload":"2020-09-15T00:58:07.652Z","extensionVersion":"v3.4.3"}
<?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
#! /bin/bash
#####################################################
echo "abdelsalam" >> file.txt
#####################################################
#####################################################
: '
ahmed
sayed
<?php
namespace App\Http\Traits;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Resources\Json\JsonResource;
trait ApiResponder
{
/**
#!/usr/bin/env php
<?php
function base64UrlEncode($text)
{
return str_replace(
['+', '/', '='],
['-', '_', ''],
base64_encode($text)
);