This file contains hidden or 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 | |
name=$RANDOM | |
url='http://localhost:9093/api/v1/alerts' | |
echo "firing up alert $name" | |
# change url o | |
curl -XPOST $url -d "[{ | |
\"status\": \"firing\", |
This file contains hidden or 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 enum_example | |
import ( | |
"bytes" | |
"encoding/json" | |
) | |
// TaskState represents the state of task, moving through Created, Running then Finished or Errorred | |
type TaskState int |
This file contains hidden or 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
# Pseudo-hilbert curve generator. Maps ordered items from an array (1D) to a rectangle (2D) | |
# in a way that best retains the distances between indexes of the initial array as euclidean distances in the rectangle | |
# | |
# Hilbert curves are only possible for powers of 2, so the gilbert() function instead tries to fit as many hilbert | |
# "blocks" together as possible. This is through a greedy approach and works well enough for my needs | |
# | |
# Free for any use, but let me know so I know someone found it useful :) | |
# | |
# AUTHOR : James Zingel (2022) |
OlderNewer