Skip to content

Instantly share code, notes, and snippets.

View 46bit's full-sized avatar
🏳️‍🌈

Miki Mokrysz 46bit

🏳️‍🌈
View GitHub Profile
@46bit
46bit / cookiecaster-microservices.md
Last active September 17, 2020 20:19
Rebuilding http://www.cookiecaster.com as a set of microservices to learn.

Cookiecaster in microservices

Key

  • deployable microservice
    • endpoint
      • parameters

Sketch

global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets: []
scheme: http
timeout: 10s
@46bit
46bit / hug-me
Created June 2, 2018 18:51
This script `*huuug*`s. I include this in my shell profile `.zshrc` to print hugs at the top of each new terminal.
#!/usr/bin/env ruby
u_count = 1 + Random.rand(9)
puts "*h" + ("u" * u_count) + "g*"
if ARGV.include? "lovingly" then
puts "I fucking love you <3"
end
@46bit
46bit / eg.math.v3
Created February 21, 2018 23:02
This would be a good start for a general-purpose language. By adding a string type to this example, and adding a special system library, you could program basic servers and the like.
import('math/*')
import('./g')
f(a: i64, b: i64, c: i64) -> (i64, i64) {
x = a + 5;
y = b * c * x;
(x, y)
}
main(inputs: [i64]) -> i64 {
inputs gy, he, tjysw, jhsw, zjhpilpu;
jdddvctj(xj, lazr_coheh, ws, lhhra_, j, lsmpwolvjr, efxfz, weia) = (1 + (2 + 8) / -9 * 4 / -5 * -6 * (9 - 0) / ((-1 / 3) * 2 + (-1 * 7 - -7))) * ((-6 / (-7 + -4)) * lsmpwolvjr - match 0 { 1 => -10, 4 => 8, _ => -9, }) * xj - 1;
iqyrhktzc(dup) = match dup * 1 - match -7 { 3 => 8, -5 => -7, _ => 2, } { match 6 { -2 => -1, 7 => -6, 1 => 1, _ => 7, } => dup / (5 / -3) * -5 / -8 * (-6 - 1), dup => -10, jdddvctj(6, -7 - -9, 7, -9 * -1, 6 + -6, 8 - -10, 1 / 0, 0 * 4) => -1 * jdddvctj(9, -4 - -3, 0 + 5, 1 * -6, -6, -2, 6 - 3, 3), (6 - -6) * (1 + -6 + -9) => match -8 { -1 => 4 * 8, -6 => -2, 5 => -4 - -1, -8 => -2 * 6, _ => 5 + -10, }, jdddvctj(-1 - -4, 3, 8 / 9, 7, -6, -6, -9 / 3, -10) => match 7 - -2 { -2 => 1 * 3, 1 => -5, 5 => 6 * -3, 9 => -8, _ => 1 / -8, }, 9 => match 5 { 7 => 4 / 4, 1 => -5, -10 => 3 / 4, -8 => -6, _ => -9, }, _ => 2, };
pwjizntll = iqyrhktzc(match 1 - 5 { -9 => 4, -2 => 7 - -9, -3 => 4 * 4, _ => 0, } - iqyrhktzc(jdddvctj(7, -8, -1, 6, -9, 3, -9, 6)));
bfek
package broker
import (
"encoding/json"
"fmt"
)
type ProvisionParameters struct {
RestoreFromLatestSnapshotOf *string `json:"restore_from_latest_snapshot_of"`
}
inputs i;
j = 9 + 1;
a(x) = match x {
0 => 0,
1..2 => 1,
3..4 => 2,
5..6 | 9 => 3,
_ => 4
};
k = 7 / 2 * a(3);
https://stackoverflow.com/questions/30234027/how-to-call-printf-in-llvm-through-the-module-builder-system
input x, y, z;
f(a, b) = a / b;
g(a) = a * 3;
i = 5 * 3 + g(y) * f(x, z);
j = i + 1 + g(x);
output i, j;