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/csv" | |
"image/color" | |
"os" | |
"sort" | |
"strconv" | |
"gonum.org/v1/plot" |
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
function nSecToTime(s) { | |
let seconds = s | |
s = Math.abs(s) | |
let t = [0, 0, 0] | |
let r = s % 3600 | |
t[0] = Math.floor(s / 3600) | |
t[1] = Math.floor(r / 60) | |
r = r % 60 |
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
func CreatePDFFromHTML(inputHTML []byte) ([]byte, error) { | |
dirName, err := ioutil.TempDir("", "pdf-generator") | |
if err != nil { | |
return nil, err | |
} | |
// remove this and log the dirName if you need to debug the HTML | |
defer os.RemoveAll(dirName) | |
// log.Println(dirName) |
OlderNewer