Skip to content

Instantly share code, notes, and snippets.

@blzjns
blzjns / trivy_templating.md
Last active March 29, 2022 22:10
How to use golang templates for generating custom trivy reports

Trivy templating

Trivy uses golang templates. Thus, whenever opening a tag {{an_opening_tag}}, most likely it needs to be closed with {{end}}.

For example:

The tag range works similarly to a for-each loop, where . represents an initial object

{{range . as $myObj}}--- This a text concatenating {{$myObj.Target}} ---{{end}}
@blzjns
blzjns / trie.js
Last active April 11, 2022 07:24
Find words using a tree-like struct (Trie)
/*
E.g.:
[root-node]
/ | \
B D S
/ | \
A O__ E__
/\ \ \ \