💁♂️
This file contains hidden or 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
| // 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
| // You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
| (() => { | |
| const SHOW_SIDES = false; // color sides of DOM nodes? | |
| const COLOR_SURFACE = true; // color tops of DOM nodes? | |
| const COLOR_RANDOM = false; // randomise color? | |
| const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
| const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
| const THICKNESS = 20; // thickness of layers | |
| const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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"` |
NewerOlder