Skip to content

Instantly share code, notes, and snippets.

View luisfranciscocesar's full-sized avatar

Luis Francisco luisfranciscocesar

View GitHub Profile
@luisfranciscocesar
luisfranciscocesar / gitflow-breakdown.md
Created February 23, 2021 03:14 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@luisfranciscocesar
luisfranciscocesar / Example.js
Created December 29, 2020 22:05 — forked from aeciolevy/Example.js
Example of mongoose transaction. MongoDB transaction example
exports.deleteUser = async (req, res, next) {
const session = await mongoose.startSession();
try {
const { id } = req.params;
// Start session
await session.startTransaction();
// deleteMany in this session
const [errorOp, result] = await toAll([App.deleteMany({ user: id }).session(session), UserModel.findByIdAndRemove(id).session(session)]);
if (errorOp) {
throw new ErrorRequest(STATUS_CODE.UNPROCESSABLE, errorOp.message);
@luisfranciscocesar
luisfranciscocesar / Example.js
Created December 29, 2020 22:05 — forked from aeciolevy/Example.js
Example of mongoose transaction. MongoDB transaction example
exports.deleteUser = async (req, res, next) {
const session = await mongoose.startSession();
try {
const { id } = req.params;
// Start session
await session.startTransaction();
// deleteMany in this session
const [errorOp, result] = await toAll([App.deleteMany({ user: id }).session(session), UserModel.findByIdAndRemove(id).session(session)]);
if (errorOp) {
throw new ErrorRequest(STATUS_CODE.UNPROCESSABLE, errorOp.message);
@luisfranciscocesar
luisfranciscocesar / instalacion.md
Last active June 5, 2020 04:26 — forked from pokisin/instalacion.md
Instalar LAMP en arch linux (Manjaro)

Pasos para instalar LAMP en Manjaro

  1. Abrimos la terminal y ejecutamos la siguiente linea para actualizar la base de datos de los paquetes
  sudo pacman -Syu
  1. Instalamos el apache y ejecutamos lo siguiente
  sudo pacman -S apache