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
var err error | |
// set default page sra3 | |
sra3 := gofpdf.SizeType{450, 320} | |
pdf := gofpdf.NewCustom(&gofpdf.InitType{UnitStr: "mm", Size: sra3}) | |
pdf.SetCompression(false) | |
// Margins of page | |
pdf.SetMargins(0.0, 0.0, 0.0) | |
pdf.SetAutoPageBreak(false, 0.0) |
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
sed -i -e 's/<img src="\[HOST\]\/img\/\([^"]*\)"/<img src="[HOST]\/img\/\1" srcset="[HOST]\/img\/\1 700w,[HOST]\/img\/400w\/\1 400w" sizes="(max-width: 480px) 100vw, 70vw"/g' <html-file> |
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 ( | |
"context" | |
"fmt" | |
"log" | |
"os" | |
"os/signal" | |
"strconv" | |
"time" |
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 ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
year, m := 2018, time.Month(11) | |
tfirst := time.Date(year, m, 1, 0, 0, 0, 0, time.UTC) |
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 ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
year, m := 2018, time.Month(1) | |
tfirst := time.Date(year, m, 1, 0, 0, 0, 0, time.UTC) |
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
func readLastLine(f *os.File) (string, error) { | |
sz, err := f.Seek(0, io.SeekEnd) | |
if err != nil { | |
return "", err | |
} | |
// ensure we avoid eventually last \n |
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
window.$ = document.getElementById.bind(document); | |
window.$$ = document.querySelectorAll.bind(document); | |
Packer = function(w, h) { | |
this.init(w, h); | |
}; | |
Packer.prototype = { | |
init: function(w, h) { |
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
.select { | |
background-color: white; | |
display: flex; | |
flex-wrap: nowrap; | |
align-items:center; | |
} | |
.select:after { | |
content: "\f078"; | |
font-family: 'FontAwesome'; |
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
find . -name <Pattern for files from Source Directory> -type f -exec bash -c 'tmp="${1//[\/ ]/-}";cp "{}" <Destination>/${tmp:2}' _ {} \; |
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
#!/bin/bash | |
# useit: ./.imagery <directory source> <dist directory> | |
# example: ./.imagery ~/Projects/printuridigital.ro/stock-images/pipes/ pipes | |
from="$1" | |
root="$2" | |
p20="$root/20" | |
p100="$root/100" | |
p250="$root/250" |