Skip to content

Instantly share code, notes, and snippets.

{
"version": 4,
"terraform_version": "1.0.8",
"serial": 131,
"lineage": "fe327e48-93a1-a047-b1c5-66bc296d0c76",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "datadog_integration_slack_channel",
lvh.me {
tls self_signed
proxy / http://127.0.0.1:3000/ {
transparent
}
}
package main
import (
"bytes"
"context"
"encoding/csv"
"encoding/json"
"fmt"
"io"
"log"
⠁ git checkout config/i18n-js.yml
I, [2019-09-04T09:38:15.969595 #973] INFO -- : listening on addr=0.0.0.0:3000 fd=26
I, [2019-09-04T09:38:15.988478 #973] INFO -- : master process ready
I, [2019-09-04T09:38:16.003390 #1355] INFO -- : worker=0 ready
/usr/local/bundle/gems/activesupport-5.0.7.2/lib/active_support/inflector/methods.rb:69: [BUG] Segmentation fault at 0x0000000000000040
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0056 p:---- s:0366 e:000365 CFUNC :sub
c:0055 p:0023 s:0361 e:000360 METHOD /usr/local/bundle/gems/activesupport-5.0.7.2/lib/active_support/inflector/methods.rb:69
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
class LoggingTransactionalMailer < TransactionalMailer
def send_mail(user, mail)
p "sending email to user #{user.id}"
super(user.email, mail.body)
end
end
class BlockingLoggingTransactionalMailer < LoggingTransactionalMailer
def send_mail(user, mail)
return unless @user.has_active_subscription?
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
class BaseUserMailer
SMTP_SETTINGS = ...
def initialize()
@client = MailSendingLibrary.new(SMTP_SETTINGS)
end
def send_mail(user, mail)
@client.send_mail(user.email, mail.body)
{
"Keyboard Map" : {
"0xf700-0x260000" : {
"Action" : 10,
"Text" : "[1;6A"
},
"0x37-0x40000" : {
"Action" : 11,
"Text" : "0x1f"
},

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