Skip to content

Instantly share code, notes, and snippets.

@Akanoa
Akanoa / Cargo.toml
Last active October 31, 2022 18:48
Gitlab SSO
[package]
name = "gitlab-sso"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
actix-rt = "2.7.0"
actix-web = "4.2.1"
@Akanoa
Akanoa / Cargo.toml
Created September 14, 2022 17:44
Minimal
[package]
name = "test_data_fusion"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
futures = "0.3.24"
futures-util = "0.3.24"
@Akanoa
Akanoa / Cargo.toml
Created September 14, 2022 17:08
Stream<A> -> Stream<B>
[package]
name = "test_data_fusion"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
datafusion = "11.0.0"
foundationdb = {git = "https://github.com/foundationdb-rs/foundationdb-rs.git", features=["embedded-fdb-include", "fdb-7_1"]}
@Akanoa
Akanoa / double_hmac.py
Created August 29, 2022 19:09
double hmac
def verify(self, secret):
identifier = bytes(self.identifier, encoding="utf-8")
secret = bytes(secret, encoding="utf-8")
signature = hmac_sha256(secret, identifier)
for caveat in self.caveats:
signature = hmac_sha256(signature, caveat.encode("utf-8"))
@Akanoa
Akanoa / Cargo.toml
Last active August 21, 2022 19:17
Panic on datastore new
[package]
name = "surreal"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
surrealdb = {version = "1.0.0-beta.6", default-features = false, features=["parallel", "scripting", "http", "kv-echodb"]}
eyre = "0.6.8"
@Akanoa
Akanoa / defaults.dhall
Last active August 11, 2022 09:47
Dhall Docker-Compose DSL
let Map =
https://raw.githubusercontent.com/dhall-lang/dhall-lang/master/Prelude/Map/Type
let types = ./types.dhall
let Service =
{ deploy = None types.Deploy
, build = None types.Build
, cap_add = None (List Text)
, cap_drop = None (List Text)
@Akanoa
Akanoa / main.rs
Created August 9, 2022 22:24
Clockwerk async
use clokwerk::{AsyncScheduler, TimeUnits};
use std::time::Duration;
async fn job() {
dbg!("It works");
}
#[tokio::main]
async fn main() {
let mut scheduler = AsyncScheduler::new();
@Akanoa
Akanoa / Cargo.toml
Created July 19, 2022 14:36
Unwind a panicking future
[package]
name = "async-panic"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
futures = "0.3.21"
tokio = { version = "1.20.0", features = ["full"] }
@Akanoa
Akanoa / main.rs
Created July 16, 2022 16:31
Playground article télémétrie
use opentelemetry::global::shutdown_tracer_provider;
use std::future::Future;
use std::pin::Pin;
use opentelemetry::runtime::Tokio;
use rand::Rng;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::{io, join, select, spawn};
use tokio::net::{TcpListener, TcpStream};

Keybase proof

I hereby claim:

  • I am akanoa on github.
  • I am akanoa (https://keybase.io/akanoa) on keybase.
  • I have a public key ASD6tgCndegGQMHe3KFGyYPfyM_eSKtvDGAIIvI_v3ul8Ao

To claim this, I am signing this object: