See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| import CryptoJS from "crypto-js"; | |
| const DataEncrypt = function () { | |
| this.key = CryptoJS.enc.Base64.parse(process.env.MIX_APP_KEY.substr(7)); | |
| } | |
| DataEncrypt.prototype.encrypt = function (data) { | |
| let iv = CryptoJS.lib.WordArray.random(16); | |
| let encrypted = CryptoJS.AES.encrypt(data, this.key, { | |
| iv: iv, |
A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.
Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.
| # Install NVM, NodeJS, Yarn via Homebrew | |
| ## WARNING ## | |
| Dear all Github friends, | |
| I moved this gist to the Github repository. | |
| Following this repository | |
| https://github.com/nijicha/install_nodejs_and_yarn_homebrew |
| #!/bin/bash | |
| # Se define la lista de patrones incluidos para validación | |
| PATHS='composer.json' | |
| if [ -f .gitcharset ] ; then | |
| PATHS="$PATHS|`sed ':a;N;$!ba;s/\n/|/g' .gitcharset`" | |
| fi | |
| # Se recore cada uno de los ficheros incluidos para el compromiso y se validan unicamente aquellos que cumplan la expresión definida en el $PATH |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
| #!/bin/bash | |
| # Creamos una variable en el bash para almacenar las ramas a la que no deseamos aplicar la regla si dicha variable no existe | |
| if [ -z "$BRANCHES_TO_SKIP" ]; then | |
| BRANCHES_TO_SKIP=(master develop test) | |
| fi | |
| # Obtenemos el correo configurado en el equipo | |
| USER_EMAIL=$(git config user.email) |
| ## git superlog | |
| git config --global alias.superlog "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all" |