This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# | |
# Snapshot archive of all contents in the folder defined in a variable | |
# called $SOURCE, using $TAR_OPTS tar options. | |
# | |
# Created MM, 2012-01-21 | |
# Revised MM, 2023-11-03 | |
set -eu | |
source ${COMMON_UTILS}/utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# FizzBuzz -- created by M. Massenzio, 2022-03-26 | |
import sys | |
n = sys.argv[1] | |
for i in range(3, int(n) + 1): | |
out = "" | |
if i % 3 == 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"github.com/go-redis/redis/v8" | |
"os" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
// Tempting, but this will NOT compile | |
// | |
//func (arr []interface{}) Has(x interface{}) bool { | |
// for _, val := range arr { | |
// if val == x { | |
// return true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping("/api/users") | |
public class UserController { | |
@Autowired | |
private UserRepository userRepository; | |
@Autowired | |
private UserService userService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Comment": "A state machine to experiment with errors", | |
"StartAt": "Error Handler", | |
"States": { | |
"Error Handler": { | |
"Type": "Task", | |
"Resource": "arn:aws:states:::lambda:invoke", | |
"OutputPath": "$.Payload", | |
"Parameters": { | |
"Payload.$": "$", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
set -eu | |
ROLE=${1:-} | |
if [[ -z ${ROLE} ]]; then | |
printf "Usage: delete-iam-role ROLE\n\nERROR: ROLE must be specified\n" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to load fonts via Python PIL. | |
# See Stack OF question: https://stackoverflow.com/questions/24085996/how-i-can-load-a-font-file-with-pil-imagefont-truetype-without-specifying-the-ab/41887497#41887497 | |
from PIL import Image, ImageDraw, ImageFont | |
# sample text and font | |
unicode_text = u"Arial Font, size 28px" | |
font = ImageFont.truetype("/Library/Fonts/Arial.ttf", 28, encoding="unic") | |
# get the line size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Installs minikube on MacOS | |
# See: https://github.com/kubernetes/minikube/releases | |
declare -r VERSION=${1:-} | |
if [[ -z ${VERSION} ]]; then | |
echo "Please specify a version" | |
exit 1 |
NewerOlder