Skip to content

Instantly share code, notes, and snippets.

@lfcunha
lfcunha / 2-3.py
Created October 11, 2012 23:01
2.3
import math
balance=10050000
annualInterestRate=0.2
monthly=annualInterestRate / 12
lo=balance/12
hi=balance+(balance * annualInterestRate)
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
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

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:

__author__ = "Luis C"
__date__ = "09_24_2015"
"""
Data Analysis and Interpretation Specialization
First course: Data Management and Visualization
Week 2: Write your first program
"""
@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
@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.

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 / 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'
@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: