Skip to content

Instantly share code, notes, and snippets.

@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?

@aghosn
aghosn / kvm.go
Created March 18, 2020 16:43
a small hacky kvm example in go
package main
// #include <linux/kvm.h>
// #include <stdio.h>
// #include <err.h>
//
// static int myhandler(void* r) {
// struct kvm_run* run = (struct kvm_run*) r;
// switch (run->exit_reason) {
// case KVM_EXIT_HLT:
@panzerdev
panzerdev / main.go
Last active March 16, 2019 18:06
Topic based Worker with Redis example
package main
import (
"fmt"
"github.com/go-redis/redis"
"log"
"math/rand"
"os"
"os/signal"
"syscall"
/var/folders/4s/l39wbkz55tx10gb1lfdvj6th0000gn/T/python-build.20181120064129.76625 ~
11/20 06:41:31 [NOTICE] Downloading 1 item(s)
11/20 06:41:31 [NOTICE] Allocating disk space. Use --file-allocation=none to disable it. See --file-allocation option in man page for more details.
[#3fb641 6.1MiB/16MiB(37%) CN:1 DL:7.0MiB ETA:1s]
[#3fb641 13MiB/16MiB(80%) CN:1 DL:7.0MiB]
11/20 06:41:34 [NOTICE] Download complete: /private/var/folders/4s/l39wbkz55tx10gb1lfdvj6th0000gn/T/python-build.20181120064129.76625/Python-3.6.7.tar.xz
@klingtnet
klingtnet / how-to-upgrade-nvmw-ssd-firmware-on-linux.md
Last active January 25, 2025 23:19
How to upgrade [Lenovo] NVMe SSD firmware on Linux

The instructions were tested on a Lenovo X1 Carbon 5th Gen (X1C5) on Arch Linux but should be applicable to other Lenovo models and Linux distributions.

BACKUP YOUR DATA! I created a bootable Ubuntu Image like this:

$ sudo sh -c 'curl --location --silent --fail "http://releases.ubuntu.com/18.04/ubuntu-18.04.1-desktop-amd64.iso" | pv > /dev/<your-usb-drive>'
# note that pv is only there to show progress, it is perfectly fine to redirect curl to the usb drive directly.

then I booted from this drive by pressing F12 on reboot and dumped my NVMe disk to an external hard drive like this:

@grantseltzer
grantseltzer / disassembler.go
Created September 14, 2018 06:08
Full disassembler
package main
import (
"debug/elf"
"fmt"
"log"
"os"
"github.com/bnagy/gapstone"
)
@fasiha
fasiha / no-hackerrank.md
Last active August 7, 2023 11:47
A prospective employer invited me to do a HackerRank test. Here's my proposed alternative.

Well, that was unexpected. In the following, I’m trying to follow Jon Evans’ advice from “The Terrible Technical Interview”.


To: [email protected]
From: Ahmed Fasih
Subject: Re: Programming Test Invitation

Hi there! Thanks for offering to let me take a HackerRank test for ABC, I appreciate the vote of confidence.

@John-Lin
John-Lin / Kubeflow.md
Last active November 10, 2022 19:31
Kubeflow on Minikube

Deploy Kubeflow on Minikube

Install minikube

Please see How to Minikube

Running a minikube with 4CPUs and 8GB memory

$ minikube start --cpus 4 --memory 8192
@mromanello
mromanello / process BMCR.ipynb
Created November 23, 2017 11:23
Quick and dirty notebook to demonstrate the extraction of canonical references from one BMCR record.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wwek
wwek / httpsproxy.go
Created October 29, 2017 05:41
https proxy in golang
// https://medium.com/@mlowicki/http-s-proxy-in-golang-in-less-than-100-lines-of-code-6a51c2f2c38c
// #!/usr/bin/env bash
// case `uname -s` in
// Linux*) sslConfig=/etc/ssl/openssl.cnf;;
// Darwin*) sslConfig=/System/Library/OpenSSL/openssl.cnf;;
// esac
// openssl req \
// -newkey rsa:2048 \
// -x509 \