Skip to content

Instantly share code, notes, and snippets.

@mazza
mazza / xz.sh
Last active May 1, 2019 02:43
Shell Script to 'build' xz for x86_64-linux-gnu (static, portable, cross-distro). It uses: base64, gzip and chmod [+ env, sh | bash]
#!/usr/bin/env sh
# usage:
# curl -s https://gist.githubusercontent.com/mazza/669370d445a628699342d6a18fae40d7/raw|sh
# or
# wget -qO- https://gist.githubusercontent.com/mazza/669370d445a628699342d6a18fae40d7/raw|sh
base64 -d <<'::' | gzip -d > xz; chmod +x xz
H4sIAJz3yFwCA9z9C3xU1dUwDs/JzCQDBM6AQYIgJjpoIqgZxZoRInPIDDkDE4gCgvVGq6VYrGKY
ISgICSeRbA6jtGK1VauttrWtVloVwy2ZSUgmAYFwR1AIKHCGEQggIQTIfGutfSa32ud53+d9///v
#!/usr/bin/env python3
#------------------------------------------------------------------------------#
# Snippet to try out a concept of Go2 drafts (generics) using Python. #
#------------------------------------------------------------------------------#
#=> The relevant part is at line 30, where we define a method
# for more than one type at once. Both have field "baz".
# pylint: disable=E1101
@mazza
mazza / compile.sh
Last active September 28, 2018 04:03
Shell script for a quick/didactic showing of Go powers (http.FileServer) + stuff
#!/usr/bin/env bash
cd "`dirname $0`"
# check if the programs we use are available
command -v go >/dev/null 2>&1 || {
echo "go should be installed! ( Go https://golang.org )"
xdg-open "https://golang.org/dl/" >/dev/null 2>&1
exit 1
}