Skip to content

Instantly share code, notes, and snippets.

View miguelortizdev's full-sized avatar
:octocat:
Pushing the limits

Miguel Ortiz miguelortizdev

:octocat:
Pushing the limits
View GitHub Profile
@miguelortizdev
miguelortizdev / laravel-encrypt.js
Created January 3, 2023 19:09 — forked from trappistes/laravel-encrypt.js
laravel Encrypt convert to CryptoJS in Javascript
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,

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@miguelortizdev
miguelortizdev / git-reset-author.sh
Created June 17, 2021 14:37 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@miguelortizdev
miguelortizdev / GitCommitBestPractices.md
Created June 17, 2021 13:34 — forked from luismts/GitCommitBestPractices.md
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

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.

Commit Often

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
@miguelortizdev
miguelortizdev / pre-commit
Last active September 25, 2019 15:18
UTF-8 validation files for multiple character set projects
#!/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
@miguelortizdev
miguelortizdev / README-español.md
Created September 16, 2019 15:13 — forked from Villanuevand/README-español.md
Una plantilla para hacer un buen README.md. Inspirado en el gist de @PurpleBooth => https://gist.github.com/PurpleBooth/109311bb0361f32d87a2

Título del Proyecto

Acá va un párrafo que describa lo que es el proyecto

Comenzando 🚀

Estas instrucciones te permitirán obtener una copia del proyecto en funcionamiento en tu máquina local para propósitos de desarrollo y pruebas.

Mira Deployment para conocer como desplegar el proyecto.

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.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

#!/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"