Skip to content

Instantly share code, notes, and snippets.

@TheQueenIsDead
TheQueenIsDead / progress-bar.tf
Created January 23, 2023 22:05
Terraform code for generating a text representation of a progress bar given an input percentage
# Context
# https://twitter.com/mitchellh/status/1615797167607939072
# https://marcofoco.com/blog/2023/01/21/10-balls/?fbclid=IwAR0PL9VxEjFMZ6sq2J8KIJRY2PSaPPTP6cBu12lrlWe0__9OGzE02yGNBRQ
variable "input_percentage" {
description = "A numerical percentage given as a float representation between 0.0 and 1.0 (Eg. `0.33`)"
type = number
validation {
condition = var.input_percentage >= 0.0
@TheQueenIsDead
TheQueenIsDead / iterate_json.go
Created November 4, 2022 00:18
An example of iterating an 'unknown' JSON payload in Go
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"strings"
)
@TheQueenIsDead
TheQueenIsDead / terraform_for.tf
Created March 20, 2022 20:47
Terraform "Nested for loop"
locals {
replicas = 5
instances = [
"001",
"002",
"003",
]
}
@TheQueenIsDead
TheQueenIsDead / ll.py
Last active June 23, 2021 05:25
Reversing a Linked List
import pprint
import sys
from time import perf_counter
class Node(object):
previous: 'Node'
next: 'Node'
value: int