Skip to content

Instantly share code, notes, and snippets.

@Akanoa
Akanoa / matex-bot.rb
Last active December 24, 2015 16:27
Converts LateX language into human readable characters
require 'sinatra'
require 'sinatra'
require "cgi"
require 'json'
require 'tex2png'
def upload(path)
`curl -F file=@#{path} -F token=xoxp-xxxxxxxxx-xxxxxxxxx https://slack.com/api/files.upload`
end
@Akanoa
Akanoa / time_tracker.rs
Created August 22, 2021 09:50
A simple Time Tracker in Rust
struct TimeTracker {
start: Instant,
name: &'static str,
}
impl TimeTracker {
fn new(name: &'static str) -> Self {
TimeTracker {
start: Instant::now(),
name,
#!/bin/sh
###################
# Define variables
###################
## Public bridge holds physical interface (public IP, output gateway)
PublicBridge="vmbr0"
## WAN bridge ( holds WanNetwork )
@Akanoa
Akanoa / cpf.md
Last active March 20, 2022 08:22
CFP : Camping des Speakers

La Cuisine m'a sauvé du Burn-out

Abstract

Nous faisons pour beaucoup d'entre nous ce métier par passion. Il y a tellement de choses différentes à découvrir et les choses évoluant tellement vites que l'on peut assez facilement se laisser déborder.

Notre métier nous impose une charge mentale permanente et une sollicitation de notre capacité d'abstraction qui ne se retrouvent que dans très peu de métiers.

Tout comme chacun de nos muscles s'ils sont trop sollicités, ils peuvent claquer.

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:

@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};
@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 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 / 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 / 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"