This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a small exmaple cli application for sending emails | |
// | |
// Expects a .env with the following configuration: | |
// | |
// EMAIL_ADDRESS=<from address> | |
// EMAIL_PASSWORD=<app password> | |
// EMAIL_HOST=smtp.gmail.com | |
// EMAIL_PORT=587 | |
// RECIPIENT=<optional> | |
// SITEMAP=<optional> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a small exmaple cli application for sending emails | |
// | |
// Expects a .env with the following configuration: | |
// | |
// EMAIL_ADDRESS=<from address> | |
// EMAIL_PASSWORD=<app password> | |
// EMAIL_HOST=smtp.gmail.com | |
// EMAIL_PORT=587 | |
// RECIPIENT=<optional> | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import os | |
import subprocess | |
import sys | |
import time | |
# Required so we don't generate tons of logs during restore | |
disable_logging_sql = "ALTER USER postgres RESET pgaudit.log;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zsh -ixc : 2>&1 | grep ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"html-to-pdf/model" | |
"html-to-pdf/pdf" | |
"html-to-pdf/template" | |
"log" | |
"net/http" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"html-to-pdf/model" | |
"html-to-pdf/pdf" | |
"html-to-pdf/template" | |
"io/ioutil" | |
"log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package template | |
import ( | |
"bytes" | |
"html/template" | |
) | |
type HTMLTemplateInterface interface { | |
Compile(interface{}, string) (bytes.Buffer, error) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{define "PDF"}} | |
<!DOCTYPE html> | |
<html lang="en"> | |
<body> | |
<div class="page cover"> | |
<div class="wrapper"> | |
<div class="banner"> | |
<h1>{{ .CompanyName }} Official Document</h1> | |
<p>Preseted to {{ .FullName }}</p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package model | |
import ( | |
"fmt" | |
"strings" | |
"time" | |
) | |
type PDF struct { | |
FirstName string `json:"FirstName" example:"Tony"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pdf | |
import ( | |
"bytes" | |
pdf "github.com/SebastiaanKlippert/go-wkhtmltopdf" | |
) | |
type PDFProviderInterface interface { | |
CreatePDF(bytes.Buffer) ([]byte, error) |
NewerOlder