Skip to content

Instantly share code, notes, and snippets.

😄
CEO of my life, CTO of my localhost, co-founder of my son

Mohamed Hafez Abdallah mohamedhafezqo

😄
CEO of my life, CTO of my localhost, co-founder of my son
Block or report user

Report or block mohamedhafezqo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mohamedhafezqo
mohamedhafezqo / vichUploaderBundle.md
Created Jul 10, 2019
How to install to dustin10/VichUploaderBundle
View vichUploaderBundle.md

Installation

Get the bundle using composer

Add VichUploaderBundle by running this command from the terminal at the root of your Symfony project:

composer require vich/uploader-bundle
@mohamedhafezqo
mohamedhafezqo / example.php
Last active Mar 4, 2019
GraphQL Client For PHP Using Guzzle
View example.php
<?php
$endPoint = 'https://api.github.com/graphql';
$query = <<<'GRAPHQL'
query getUsers {
user {
id
name
}
@mohamedhafezqo
mohamedhafezqo / squash-commits.sh
Created Oct 1, 2018 — forked from jbub/squash-commits.sh
git squash last two commits into one
View squash-commits.sh
git rebase --interactive HEAD~2
# we are going to squash c into b
pick b76d157 b
pick a931ac7 c
# squash c into b
pick b76d157 b
s a931ac7 c
@mohamedhafezqo
mohamedhafezqo / InsightsToRefactor.md
Last active Sep 2, 2018
Refactoring Legacy Code
View InsightsToRefactor.md

Comments Code Smell

  • Remove unnecessary comments.
  • If the code is obvious, don’t write a comment.
  • Don’t leave commented old code.
  • Remove commented debugging var_dump, dump, echo, ..etc.

Best Practices:

@mohamedhafezqo
mohamedhafezqo / GitAliases.md
Last active Feb 22, 2019
My Simply Git Aliases That Make Me Breakthrough
View GitAliases.md

Git Aliases

git config --global alias.ck checkout

git config --global alias.ct commit

git config --global alias.st status

git config --global alias.pl pull

View CreditStatus.php
<?php
namespace ACM\Bundle\CreditBundle\Constant;
final class CreditStatus implements IConstant
{
const PENDING = 1;
const PENDING_LABEL = 'Pending';
const SUCCESS = 2;
You can’t perform that action at this time.