Skip to content

Instantly share code, notes, and snippets.

@lfcunha
lfcunha / gist:ede1016e9ca8bae3502c9900974cd2aa
Created May 3, 2020 16:38
ftdna_welcome_email_template
<p><span style='font-size: 12pt; font-family: verdana, geneva; color: black;'><table
style='height: 900px; background-color: #f2f2f2; margin-left: auto; margin-right: auto; width: 845px;'><tbody><tr><td
style='width: 835.333px;'><table
style='height: 850px; background-color: #ffffff; margin-left: auto; margin-right: auto;' border='0' width='744'><tbody><tr
style='height: 50px;'><td style='width: 735.00px; height: 50px;'><p style='text-align: justify;'><img
style='display: block; margin-left: auto; margin-right: auto;'
src='https://s3.us-east-2.amazonaws.com/tovana-health-uploads/logo.jpg' alt='' width='153' height='65'/>
</p></td></tr>
<tr style='height: 711px;'>
<td style='width: 735.00px; height: 711px;'><p>Dear {{customer_name}},</p>
@lfcunha
lfcunha / gist:ba9e3a19765a499b3641eaa8a98d2421
Created October 2, 2019 02:15 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@lfcunha
lfcunha / tovanahealth_api_client.py
Created December 7, 2018 00:39
TovanaHealth API usage demo
import json
import requests
from requests_aws4auth import AWS4Auth
aws_key = '<CHANGEME>'
aws_secret = '<CHANGEME>'
region = 'us-east-2'
aws_service = 'execute-api'
api_endpoint = 'https://api.tovanahealth.com/ftdna/kit'
openapi: "3.0.1"
info:
title: "tovanahealth"
version: "2018-11-29T06:50:41Z"
servers:
- url: "https://api.tovanahealth.com/{basePath}"
variables:
basePath:
default: "/ftdna"
paths:
@lfcunha
lfcunha / letsencrypt_2017.md
Created April 27, 2018 01:17 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@lfcunha
lfcunha / data_visualization_wk3.py
Created October 5, 2015 00:57
data_visualization_wk3
__author__ = 'luiscunha'
# -*- coding: utf-8 -*-
"""
Created on 10/03/2015
@author: Luis Cunha
"""
import pandas
__author__ = "Luis C"
__date__ = "09_24_2015"
"""
Data Analysis and Interpretation Specialization
First course: Data Management and Visualization
Week 2: Write your first program
"""

Keybase proof

I hereby claim:

  • I am lfcunha on github.
  • I am lfcunha (https://keybase.io/lfcunha) on keybase.
  • I have a public key whose fingerprint is 0AFA BDD9 265E 0FC8 CE1C 948B EB98 2777 99A7 9168

To claim this, I am signing this object:

from numpy import loadtxt, zeros, ones, array, linspace, logspace
from pylab import scatter, show, title, xlabel, ylabel, plot, contour
#Evaluate the linear regression
def compute_cost(X, y, theta):
'''
Comput cost for linear regression
'''
#Number of training samples
from numpy import loadtxt, zeros, ones, array, linspace, logspace, mean, std, arange
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from pylab import plot, show, xlabel, ylabel
#Evaluate the linear regression
def feature_normalize(X):
'''
Returns a normalized version of X where