Skip to content

Instantly share code, notes, and snippets.

View brayvasq's full-sized avatar
🏠
Working from home

Brayan Vasquez brayvasq

🏠
Working from home
View GitHub Profile
@brayvasq
brayvasq / python_emails.py
Created October 3, 2020 20:59
Send emails with Python and Gmail SMTP server
# main.py
# Import section ....
import os
import sys
from dotenv import load_dotenv
from smtplib import SMTP, SMTPException # Import SMTP module
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
import email.encoders
@brayvasq
brayvasq / python_pdf.py
Created September 27, 2020 23:39
Python PDF xhtml2pdf
# main.py
# import section ....
from xhtml2pdf import pisa # import python module
import sys
# Constants section ....
# Content to write in our PDF file.
SOURCE = "<html><body><p>PDF from string</p></body></html>"
# Filename for our PDF file.
@brayvasq
brayvasq / sumMatrix.js
Last active February 14, 2019 02:20
Backtracking solution to problem that locate the numbers from 1 to (n*n) in a board, Checking that the sum of all the rows, all the columns and the main diagonals are the same.
/**
* @author brayan vasquez <brayvasq@gmail.com>
* @version 0.1
* @date 13/02/2019
*/
/**
* Size of matrix n*n
*/
const n = 3