Command | Description |
---|---|
git config --global user.name "firstName lastName" |
make sure to provide your actual name |
git config --global user.email "userName@gmail.com" |
make sure to provide your actual email address |
git config --global color.ui true |
Display the command-line UI in color |
git config --global push.default current |
When pushing code, always push only your current branch to a branch of the same name |
git config --global fetch.prune true |
Automatically prune deleted branches from your local copy when you fetch (or pull) |
git config --global core.autocrlf false |
Tell git not to mess with your line endings |
This file contains 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 | |
$endPoint = 'https://api.github.com/graphql'; | |
$query = <<<'GRAPHQL' | |
query getUsers { | |
user { | |
id | |
name | |
} |
This file contains 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
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 |
- 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.
- Follow Psr2: https://www.php-fig.org/psr/psr-2/
This file contains 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 | |
// Using built in metod `count_chars` | |
function isAnagram(string $a, string $b): bool | |
{ | |
return count_chars(strtolower($a), 1) == count_chars(strtolower($b), 1); | |
} | |
// Using array_diff expected $a or $b consists from [a-z] | |
function isAnagram(string $a, string $b): bool |
This file contains 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 ACM\Bundle\CreditBundle\Constant; | |
final class CreditStatus implements IConstant | |
{ | |
const PENDING = 1; | |
const PENDING_LABEL = 'Pending'; | |
const SUCCESS = 2; |
Getting started:
Related tutorials:
- MySQL-CLI: https://www.youtube.com/playlist?list=PLfdtiltiRHWEw4-kRrh1ZZy_3OcQxTn7P
- Analyzing Business Metrics: https://www.codecademy.com/learn/sql-analyzing-business-metrics