Skip to content

Instantly share code, notes, and snippets.

Avatar

Marc Falzon falzm

View GitHub Profile
@falzm
falzm / mkcd.bash
Created Mar 3, 2021
Simple Bash function to create a directory and cd to it immediately. Creates a temporary directory by passing flag "-t".
View mkcd.bash
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))
View http_debug_roundtripper.go
package main
import (
"bufio"
"bytes"
"fmt"
"net/http"
"net/http/httputil"
"os"
)
@falzm
falzm / untag.go
Created May 18, 2019
Strip all ID3 tags from an MP3 file
View untag.go
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
Terraform sample configuration illustrating a bug with targeted "destroy" command
View tf_targeted_destroy_bug.tf
# 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",
View tcpping.go
package main
import (
"log"
"net"
"os"
"time"
)
var (
View keybase.md

Keybase proof

I hereby claim:

  • I am falzm on github.
  • I am falzm (https://keybase.io/falzm) on keybase.
  • I have a public key ASDuhM0ikKuLH23Oc2gADrFXYUpOzEiuUSfRAFg636NCMQo

To claim this, I am signing this object:

@falzm
falzm / .json
Created Oct 4, 2015
Longest combined music duration per artist
View .json
{
"took" : 21,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 8392,
@falzm
falzm / .json
Last active Jul 22, 2020
Top 10 longest album durations (fixed)
View .json
{
"took" : 22,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 8392,
@falzm
falzm / .json
Created Oct 4, 2015
Largest single album in tracks number
View .json
{
"took" : 8,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 8486,
@falzm
falzm / .json
Created Oct 4, 2015
Top 10 longest album durations
View .json
{
"took" : 63,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 8486,