Skip to content

Instantly share code, notes, and snippets.

View wagoodman's full-sized avatar
🤓

Alex Goodman wagoodman

🤓
View GitHub Profile
@wagoodman
wagoodman / main.go
Created October 6, 2023 15:23
Using syft source and file resolver objects
package main
import (
"fmt"
"github.com/anchore/syft/syft/artifact"
"github.com/anchore/syft/syft/file"
"github.com/anchore/syft/syft/pkg"
"github.com/anchore/syft/syft/pkg/cataloger/generic"
"github.com/anchore/syft/syft/source"
"io"
@wagoodman
wagoodman / main.go
Created March 30, 2022 13:25
docker auth issue
package main
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
@wagoodman
wagoodman / html.tmpl
Last active January 14, 2022 14:51
grype html template usage
<!DOCTYPE html>
<html>
<script src="https://www.kryogenix.org/code/browser/sorttable/sorttable.js"></script>
<style>
.backdrop {
background: #efefef;
}
.center {
margin-left: auto;
margin-right: auto;
@wagoodman
wagoodman / minimal.go
Last active November 14, 2023 08:52
Using syft as a library
package main
import (
"fmt"
"github.com/anchore/syft/syft"
"github.com/anchore/syft/syft/format"
"github.com/anchore/syft/syft/sbom"
"github.com/anchore/syft/syft/source"
)
@wagoodman
wagoodman / app
Last active March 10, 2018 22:08
Metaparticle talk
import flask
app = flask.Flask(__name__)
PORT = 8080
@app.route("/")
def hello():
return flask.render_template('hello.html')
def main():
### Keybase proof
I hereby claim:
* I am wagoodman on github.
* I am wagoodman (https://keybase.io/wagoodman) on keybase.
* I have a public key ASA_5InI8yymZGhWlfL6Fh200x0toTSSqRa7nYmAu_h2ZAo
To claim this, I am signing this object:
@wagoodman
wagoodman / bisect.sh
Last active November 10, 2023 15:32
Timeout a bash command (while testing with git bisect)
#!/bin/bash
timeout=290
bundle install
git checkout Gemfile.lock
./timeout.sh -t $timeout bundle exec rake assets:clobber assets:clean assets:precompile RAILS_ENV=production
package main
import (
"fmt"
"net/url"
"os"
"path"
"runtime"
"strconv"
"strings"
@wagoodman
wagoodman / sexy-minimal.bash
Created June 29, 2017 00:13
Sexy Minimal Bash Prompt theme for bash-it
# Sexy Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Screenshot: http://cloud.gf3.ca/M5rG
# A big thanks to \amethyst on Freenode
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color
elif [[ $TERM != dumb ]] && infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color
fi
if tput setaf 1 &> /dev/null; then
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then