Skip to content

Instantly share code, notes, and snippets.

View immannino's full-sized avatar
💁‍♂️
fabulous

Tony immannino

💁‍♂️
fabulous
View GitHub Profile
// 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>
// 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>
//
@immannino
immannino / migrate.py
Created October 20, 2022 18:30 — forked from bennylope/migrate.py
PostgreSQL migration script, Heroku -> Crunchy
#!/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;"
@immannino
immannino / find-where-alias-defined.sh
Created July 20, 2022 18:48
Small script to find where alias is defined in zsh
zsh -ixc : 2>&1 | grep ...
package main
import (
"encoding/json"
"fmt"
"html-to-pdf/model"
"html-to-pdf/pdf"
"html-to-pdf/template"
"log"
"net/http"
package main
import (
"encoding/json"
"fmt"
"html-to-pdf/model"
"html-to-pdf/pdf"
"html-to-pdf/template"
"io/ioutil"
"log"
package template
import (
"bytes"
"html/template"
)
type HTMLTemplateInterface interface {
Compile(interface{}, string) (bytes.Buffer, error)
}
{{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>
package model
import (
"fmt"
"strings"
"time"
)
type PDF struct {
FirstName string `json:"FirstName" example:"Tony"`
package pdf
import (
"bytes"
pdf "github.com/SebastiaanKlippert/go-wkhtmltopdf"
)
type PDFProviderInterface interface {
CreatePDF(bytes.Buffer) ([]byte, error)