Skip to content

Instantly share code, notes, and snippets.

View ndabAP's full-sized avatar
💯

Julian Claus ndabAP

💯
  • Mercedes-Benz Tech Innovation
  • Berlin, Germany
  • 14:04 (UTC +02:00)
View GitHub Profile
package main
import (
"encoding/csv"
"image/color"
"os"
"sort"
"strconv"
"gonum.org/v1/plot"
@ndabAP
ndabAP / index.js
Last active January 18, 2020 10:47
Convert seconds into format HH:MM:SS in JavaScript. Works for negative values as well
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
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)