Skip to content

Instantly share code, notes, and snippets.

View falzm's full-sized avatar
🙃

Marc Falzon falzm

🙃
View GitHub Profile
@falzm
falzm / mkcd.bash
Created March 3, 2021 08:51
Simple Bash function to create a directory and cd to it immediately. Creates a temporary directory by passing flag "-t".
mkcd() {
local dir=""
while getopts "ht" c
do
case $c in
t) dir=$(mktemp -d) ;;
h|?) echo "mkcd [-t] [DIRECTORY]" ; return ;;
esac
done
shift $((OPTIND-1))
package main
import (
"bufio"
"bytes"
"fmt"
"net/http"
"net/http/httputil"
"os"
)
@falzm
falzm / untag.go
Created May 18, 2019 08:27
Strip all ID3 tags from an MP3 file
package main
import (
"os"
"github.com/bogem/id3v2"
)
func main() {
tag, err := id3v2.Open(os.Args[1], id3v2.Options{Parse: true})
@falzm
falzm / tf_targeted_destroy_bug.tf
Created May 7, 2019 09:20
Terraform sample configuration illustrating a bug with targeted "destroy" command
# This example uses the Exoscale provider:
# https://github.com/exoscale/terraform-provider-exoscale/
locals {
zone = "ch-gva-2"
key_pair = "default"
hostnames = [
"ch2771-test1",
"ch2771-test2",
package main
import (
"log"
"net"
"os"
"time"
)
var (
@falzm
falzm / .json
Created October 4, 2015 13:03
Longest combined music duration per artist
{
"took" : 21,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 8392,
@falzm
falzm / .json
Last active July 22, 2020 18:56
Top 10 longest album durations (fixed)
{
"took" : 22,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 8392,
@falzm
falzm / .json
Created October 4, 2015 12:27
Largest single album in tracks number
{
"took" : 8,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 8486,
@falzm
falzm / .json
Created October 4, 2015 11:51
Top 10 longest album durations
{
"took" : 63,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 8486,
@falzm
falzm / .json
Created October 4, 2015 10:56
Longest single album duration
{
"took" : 59,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 8486,