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 / 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
@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 / 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 / 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 / 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 / registry-ui.yaml
Last active August 7, 2020 17:45
Docker registry + registry ui
version: '3.1'
services:
registry:
image: registry:2
ports:
- "5000:5000"
environment:
- REGISTRY_STORAGE_DELETE_ENABLED:"true"
volumes:
- ./data:/var/lib/registry
var Sequelize = require('sequelize');
var pool;
module.exports = {
getPool: function() {
if (pool) {
console.log('pool viejo '); //+ pool);
return pool;
}
pool = new Sequelize('mysql://root:root@localhost:3306/pdep', {
const echoPostRequest = {
url: pm.environment.get('baseUrl') + '/login',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
"mail": "asd@amazon.com",
"password": "HXtaSUzh"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>GROUP</groupId>
<artifactId>ARTIFACT</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
/target/
/bin/
.classpath
.project
/.apt_generated/
/.settings/
.factorypath
*.iml