Skip to content

Instantly share code, notes, and snippets.

View loverdos's full-sized avatar

Christos KK Loverdos loverdos

View GitHub Profile

Engineering themes I have been working on and refining through the years:

  • Deliver with Precision & Momentum
    • Combines speed, efficiency, and effectiveness into a single principle.
    • Stresses that delivery is not only accurate and high-quality but also done promptly and in a way that maintains consistent progress.
  • Plan & Flow
    • Emphasizes structured planning while keeping the pipeline moving.
    • Planning is dynamic and supports continuous execution, ensuring that tasks are always in progress across various stages.
  • Collaborate & Innovate
  • Encourages teamwork and creative problem-solving to fuel the pipeline with new ideas and approaches.
@loverdos
loverdos / ok.rs
Created October 25, 2024 12:15
ok.rs
pub trait IAmOk {
type T;
fn ok(self) -> Result<Self::T>;
}
impl<T> IAmOk for T {
type T = T;
fn ok(self) -> Result<Self::T> {
Ok(self)
@loverdos
loverdos / Dockerfile
Created August 5, 2024 16:40
Clean `apt` caches and DB after `apt install`
apt autoremove -y
apt autoclean -y
rm -rf /var/cache/debconf/* /var/log/* /tmp/* /var/tmp/* /var/lib/apt/lists/*
@loverdos
loverdos / async_f_type.rs
Created July 14, 2024 20:54
async_f_type.rs
use core::future::Future;
pub trait AsyncFn<T, R> {
fn call(&self, t: T) -> impl Future<Output = R>;
}
impl<F, T, R, Fut> AsyncFn<T, R> for F
where
F: Fn(T) -> Fut,
Fut: Future<Output = R>,
// tokio = { version = "1", features = ["full"] }
// tracing = "0.1.40"
// tracing-subscriber = "0.3.18"
// snafu = "0.8.3"
// exitcode = "1.1.2"
use tracing::{error as log_error};
use snafu::Report;
use tracing_subscriber;
use std::error::Error;
pub fn do_error_source<F>(source_opt: Option<&dyn Error>, f: F)
where
F: Fn(&dyn Error),
{
match source_opt {
None => {}
Some(source) => {
f(source);
@loverdos
loverdos / Logger.scala
Last active July 7, 2022 11:14
Logger with nested contexts
// Author: github.com/loverdos
// SPDX-License-Identifier: Apache-2.0
import java.io.PrintStream
final class Logger(out: PrintStream = System.out) {
private var ctx = List[String]()
private val indent_chunk = " "
private def ctx_size = ctx.length

Keybase proof

I hereby claim:

  • I am loverdos on github.
  • I am loverdos (https://keybase.io/loverdos) on keybase.
  • I have a public key ASAi41-Ewm_fgf0UGtN1aQEgDix-sDJp3LSsEyuXv4kgRgo

To claim this, I am signing this object:

@loverdos
loverdos / pbquote
Created March 1, 2016 15:54
Re-copy text as email-quoted
#!/bin/sh
# Re-copy text as email-quoted
pbpaste | sed 's/^/>/' | pbcopy
#!/usr/bin/env python
from os.path import expanduser
from ConfigParser import ConfigParser
from sys import argv
kamakirc = "%s/.kamakirc" % expanduser("~")
cfg=ConfigParser()
cfg.read(kamakirc)