Skip to content

Instantly share code, notes, and snippets.

View mesaglio's full-sized avatar
🎯
Focusing

Juan Mesaglio mesaglio

🎯
Focusing
View GitHub Profile
@mesaglio
mesaglio / Dockerfiles.md
Last active March 6, 2020 15:15
Dockerfiles examples

Simple node app

FROM node:10.15.3
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
CMD ["node", "index.js"]
@mesaglio
mesaglio / mongoConnector.js
Created February 7, 2020 19:44
singleton mongo connector
var MongoClient = require('mongodb').MongoClient
var db;
module.exports = {
connect: connect
};
async function connect(url) {
if (db) return db;
const client = await MongoClient.connect("mongodb://localhost:27017/", { useUnifiedTopology: true });
@mesaglio
mesaglio / guia.md
Last active April 24, 2020 20:19
C-Practice

Practica de C

Introduccion a tipos de datos

Contenido

  1. Tipos de datos simples
  2. Tipos de datos compuestos
  3. Variables
  4. Punteros
  5. Operadores(Capaz no)
@mesaglio
mesaglio / gitcreate.sh
Created June 24, 2019 00:28 — forked from jerrykrinock/gitcreate.sh
This script creates a new repo on github.com, then pushes to it the local repo from the current directory. Fork of https://gist.github.com/robwierzbowski/5430952/. Some of Rob's lines just didn't work for me, and I made it more verbose while fixing. UPDATE 2017-06-30. No longer needed by Xcode users because this capability is built into Xcode 9 :)
#!/bin/bash
# This script create a new repo on github.com, then pushes the local repo from the current directory to the new remote.
# It is a fork of https://gist.github.com/robwierzbowski/5430952/. Some of Rob's lines just didn't work for me, and to fix them I needed to make it more verbose so that a mere electrical engineer could understand it.
# This script gets a username from .gitconfig. If it indicates that your default username is an empty string, you can set it with
# git config --add github.user YOUR_GIT_USERNAME
# Gather constant vars
@mesaglio
mesaglio / gist:0341e31f1a67b822b5f28e9da5e1d734
Last active August 22, 2018 01:36
Send mail from console
To send a mail from mac´s console
init this config in etc/mail.rc
set smtp-use-starttls
set ssl-verify=ignore
set smtp-auth=login
set smtp=smtp://smtp.tu_proveedor_de_correo.com:587
set from="tu.direccion.de.correo@tu.proveedor"
set smtp-auth-user=tu.direccion.de.correo@tu.proveedor
set smtp-auth-password=tu.contraseña
set ssl-verify=ignore