Skip to content

Instantly share code, notes, and snippets.

View HurricanKai's full-sized avatar

Kai Jellinghaus HurricanKai

View GitHub Profile
struct RiotApiClient<T: RegionOrPlatform> {
inner: Arc<reqwest::Client>,
ratelimits: tokio::sync::Mutex<Vec<Ratelimit>>,
region_or_platform: T,
}
#[derive(Debug)]
struct Ratelimit {
pub current: u32,
pub limit: u32,
const std = @import("std");
current_off: comptime_int,
const Self = @This();
pub fn init() Self {
return .{
.current_off = 0,
};
pub const Instruction = MergeUnions(FillTemplatedAll(union(enum) {
I__Const: struct { value: u0 },
F__Const: struct { value: u0 },
}), IUnOp);
pub const IUnOp = FillTemplatedAll(union(enum) { I__Clz, I__Ctz, I__PopCnt });
const std = @import("std");
const BitWidth = enum { B32, B64 };
## Fiduciary License Agreement 2.0
based on the
## Individual Contributor Exclusive License Agreement
## (including the Traditional Patent License OPTION)
Thank you for your interest in contributing to Kai Jellinghaus's Turtler ("We" or "Us").
// PCG32 randomness
let all_randomness = vec!["pcg_state", "pcg_inc"];
const PCG32_MULT: u64 = 0x5851f42d4c957f2du64;
// note that a >> b and a << b are replaced with a / lit(2.pow(b)) and a * lit(2.pow(b)) respectively
/* let xorshifted = ((col("pcg_state") / lit(2u64.pow(18))).xor(col("pcg_state"))
/ lit(2u64.pow(27)))
.cast(DataType::UInt32);
@HurricanKai
HurricanKai / app.rs
Last active September 5, 2022 18:20
Modification of with-lunatic/submillisecond file to accomodate "max_connections"
#[derive(Clone, serde::Serialize, serde::Deserialize)]
pub enum AppMessage {
ConnectionAccepted(lunatic::net::TcpStream),
TcpStreamCompleted(),
TcpListenerClosed(),
}
#[derive(Clone, serde::Serialize, serde::Deserialize)]
pub enum ListenerMessage {
@HurricanKai
HurricanKai / settings.json
Created August 12, 2022 17:44 — forked from 7rebux/settings.json
MonkeyType settings JSON
{
"theme":"chaos_theory",
"themeLight":"serika",
"themeDark":"serika_dark",
"autoSwitchTheme":false,
"customTheme":false,
"customThemeColors":[
"#323437",
"#e2b714",
"#e2b714",

Riot Rate Limiter

Mix.install([
  {:tesla, "~> 1.4"},
  {:jason, "~> 1.3"},
  {:hackney, "~> 1.18"}
])

Hardware Setup

for each hardware piece we need the following components:

  • OS
  • Container runtime
  • Network Connection to a control plane (or be configured itself to be a control plane)
  • Potentially storage software
    • Ceph looks good here
    • Mayastor is new and quite promising
  • Things to setup:
  • Network connectivity. Kubernetes services need a way to access a "real" IP
@HurricanKai
HurricanKai / snake-on-tensors.livemd
Last active June 25, 2022 16:57
Snake game implemented with tensors

Snake on a Tensor

Mix.install([
  {:kino, "~> 0.6.1"},
  {:kino_vega_lite, "~> 0.1.1"},
  {:axon, "~> 0.1.0"},
  {:exla, "~> 0.2.2"},