Skip to content

Instantly share code, notes, and snippets.

View AhmedHelalAhmed's full-sized avatar
📱
Learning and developing

Ahmed Helal AhmedHelalAhmed

📱
Learning and developing
View GitHub Profile
@AhmedHelalAhmed
AhmedHelalAhmed / Git commands.txt
Last active August 13, 2018 11:44
Git commands
If you want to change the user use that command
$ git config user.name "John Doe"
$ git config user.email "[email protected]"
=> shortcuts for me: ((gita & gitc))
check ..... https://github.com/AhmedHelalAhmed/Helper-Bash-Scripts
//============================================//
change the email and user namd globally
$ git config --global user.name "John Doe"
$ git config --global user.email "[email protected]"
//============================================//
@AhmedHelalAhmed
AhmedHelalAhmed / requests-postman.txt
Created August 14, 2018 09:56
requests-postman-laravel
// to get token
http://localhost:8000/oauth/token
// in body tab
key .......................... value
grant_type .................... password
client_id ..................... 2
client_secret ................. client_secret in database in table.....`oauth_clients`
username ...................... <username>
password ...................... <password>
@AhmedHelalAhmed
AhmedHelalAhmed / my try in simple algorithm.py
Created September 1, 2018 20:32
my try in simple algorithm
our_string=raw_input("Enter a word ")
length = len(our_string)
if length%2 ==0:
print our_string[(length/2)-1]+our_string[length/2];
else:
print our_string[length/2]
@AhmedHelalAhmed
AhmedHelalAhmed / get_gists.py
Created September 4, 2018 21:20 — forked from leoloobeek/get_gists.py
Download all gists for a specific user
# first: mkdir user && cd user && cp /path/to/get_gists.py .
# python3 get_gists.py user
import requests
import sys
from subprocess import call
user = sys.argv[1]
r = requests.get('https://api.github.com/users/{0}/gists'.format(user))
@AhmedHelalAhmed
AhmedHelalAhmed / delete untracked directories.txt
Created September 5, 2018 13:23
delete untracked directories in git
git clean -fdx
@AhmedHelalAhmed
AhmedHelalAhmed / _ide_helper.php
Created September 6, 2018 15:36 — forked from barryvdh/_ide_helper.php
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <[email protected]>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@AhmedHelalAhmed
AhmedHelalAhmed / gitignore_global.txt
Created September 12, 2018 12:02
make global gitignore
// commands
cd
touch .gitignore_global
git config --global core.excludesfile ~/.gitignore_global
vim .gitignore_global
// for phpstorm
// in project if you add it to git already
git rm --cached .idea -r
@AhmedHelalAhmed
AhmedHelalAhmed / .bashrc
Created September 13, 2018 05:07 — forked from justintv/.bashrc
Display git branch in bash prompt
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"
@AhmedHelalAhmed
AhmedHelalAhmed / .bash_aliases
Created September 13, 2018 05:08 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@AhmedHelalAhmed
AhmedHelalAhmed / ElasticSearch - sense query.txt
Created September 17, 2018 08:37
ElasticSearch - sense query
GET _search
{
"query":
{
"match_all": {}
}
}
Get /