Skip to content

Instantly share code, notes, and snippets.

@pcasaretto
pcasaretto / -
Created November 12, 2015 16:47
<HTML>
<HEAD>
<TITLE>Moved Temporarily</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Temporarily</H1>
The document has moved <A HREF="https://accounts.google.com/ServiceLogin?service=mail&amp;passive=true&amp;rm=false&amp;continue=https://mail.google.com/mail/?ui%3D2%26ik%3D46d306e078%26view%3Dom%26th%3D150f2f8c472e525d&amp;scc=1&amp;ltmpl=default&amp;ltmplcache=2&amp;emr=1&amp;osid=1">here</A>.
</BODY>
</HTML>
package main
import (
"fmt"
"math/rand"
)
func rollDice() int {
return rand.Intn(6) + 1
}

Summary

A data visualization showing the correlation between alcohol concentration and perceived wine quality. The dataset is relative to red variants of the Portuguese "Vinho Verde" wine. The visualization showcases one of the most interesting findings during the exploratory data analysis of the dataset and also allows some exploration.

Design

module DMMT
module Time
# get current Time
def self.now
Time.zone.now
end
# get current Dime
def self.today
type fakeDriver struct {
}
type fakeConn struct {
exec func(query string, args []driver.Value) (driver.Result, error)
}
var singleton fakeConn
func (f *fakeConn) Exec(query string, args []driver.Value) (driver.Result, error) {
### Keybase proof
I hereby claim:
* I am pcasaretto on github.
* I am pcasaretto (https://keybase.io/pcasaretto) on keybase.
* I have a public key ASAFMWk6_vjOhjIt7MhC9bT0LlaxdufBcM5JuJ6Ad4BVYQo
To claim this, I am signing this object:

Golang net/http scales well! But does it grows well?

Creating an Api in Go is very simple, the Standard library gives you all the tools needed. For instance, imagine you have a movies microservice which is responsible for all CRUD operations for a vintage VHS movie store.

Suppose you have a Movie structure as described below:

type Movie struct {
    id          int
 name string
{
"Keyboard Map" : {
"0xf700-0x260000" : {
"Action" : 10,
"Text" : "[1;6A"
},
"0x37-0x40000" : {
"Action" : 11,
"Text" : "0x1f"
},
class BaseUserMailer
SMTP_SETTINGS = ...
def initialize()
@client = MailSendingLibrary.new(SMTP_SETTINGS)
end
def send_mail(user, mail)
@client.send_mail(user.email, mail.body)
class BaseUserMailer
def initialize(smtp_settings)
@client = MailSendingLibrary.new(smtp_settings)
end
def send_mail(user, mail)
@client.send_mail(user.email, mail.body)
end
end