Skip to content

Instantly share code, notes, and snippets.

View flavius's full-sized avatar

Flavius Aspra flavius

View GitHub Profile
@VaughnVernon
VaughnVernon / CONTENTS.md
Last active November 20, 2024 10:10
Hexagonal / Ports and Adapters Is Just This Simple
@graninas
graninas / What_killed_Haskell_could_kill_Rust.md
Last active May 12, 2025 12:43
What killed Haskell, could kill Rust, too

At the beginning of 2030, I found this essay in my archives. From what I know today, I think it was very insightful at the moment of writing. And I feel it should be published because it can teach us, Rust developers, how to prevent that sad story from happening again.


What killed Haskell, could kill Rust, too

What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount.

Is Haskell dead?

@chrisdone
chrisdone / gist:02e165a0004be33734ac2334f215380e
Last active April 16, 2025 07:20
Build and run minimal Linux / Busybox systems in Qemu

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@frafra
frafra / mbox2html.py
Last active February 22, 2025 03:24
Mailbox to HTML conversion using Python 3 + Jinja2 in less than 100 lines (including GPLv3 license)
#!/usr/bin/env python3
#
# Copyright (C) 2016 - Francesco Frassinelli
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

public class binarytrees {
public static void main(String[] args) throws Exception {
int n = args.length > 0 ? Integer.parseInt(args[0]) : 0;
int minDepth = 4;
int maxDepth = Math.max(minDepth + 2, n);
int stretchDepth = maxDepth + 1;
int check = (TreeNode.create(0, stretchDepth)).check();
System.out.println("stretch tree of depth " + (maxDepth + 1) + "\t check: " + check);
@lahwran
lahwran / gist:957fcd5b772cc11e79cc
Last active August 29, 2015 14:14
Hit `raw` to get a wrapped version.
Conversation about lifetimes on #rust, on mozilla's irc network,
prompted by hamnox and lahwran attempting to understand lifetimes.
Timestamps are in Mountain time.
1-30 07:09.06pm <lahwran> so we're reading this http://doc.rust-lang.org/book/ownership.html
1-30 07:09.28pm <lahwran> it mentions lifetimes a lot, and gives examples of where to use lifetimes, and the effects of lifetimes, but it has yet to actually, you know, describe what a lifetime is
1-30 07:09.48pm <theme> lahwran, I actually treat lifetimes as dependency markers
1-30 07:10.05pm <lahwran> we (my partner and I) have made several guesses as we read as to what lifetimes are, based on inference, but then we got to the point where a function used a lifetime both for an input and an output
1-30 07:10.06pm <Havvy> They're descriptions to how long a value lives.
@tartakynov
tartakynov / fourex.py
Last active December 20, 2024 08:10
Fourier Extrapolation in Python
import numpy as np
import pylab as pl
from numpy import fft
def fourierExtrapolation(x, n_predict):
n = x.size
n_harm = 10 # number of harmonics in model
t = np.arange(0, n)
p = np.polyfit(t, x, 1) # find linear trend in x
x_notrend = x - p[0] * t # detrended x
@cahna
cahna / ansible-aur-pkg-installer.md
Last active August 29, 2024 21:45
download, build, and install aur packages with ansible

About

When using ArchLinux, I typically prefer to use an AUR helper like pacaur or yaourt to automate away the process of installing a community package.

Ansible's pacman module is great, but it doesn't support AUR packages or pacman's -U flag. Installing AUR packages with Ansible seemed to be left as an exercise to the user, and since AUR helpers do not come with a fresh Arch install, I

@flavius
flavius / go-services.md
Last active August 29, 2015 13:57
Some Useful Golang-Related Services