Skip to content

Instantly share code, notes, and snippets.

@ribice
ribice / caller.go
Last active January 6, 2025 07:14
A robust rabbitmq client for Go
go func() {
for {
err = rmq.Stream(cancelCtx)
if errors.Is(err, rabbitmq.ErrDisconnected) {
continue
}
break
}
}()
@amaembo
amaembo / Test.java
Created May 19, 2020 15:12
Reified generics in Java
import java.util.*;
@SuppressWarnings("ALL")
class Test {
static class ReifiedList<T> extends AbstractList<T> {
private final List<T> delegate = new ArrayList<>();
private final Class<?> type;
@SafeVarargs
ReifiedList(@Deprecated T... unused) {
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
@stettix
stettix / things-i-believe.md
Last active July 24, 2026 12:13
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@danielmai
danielmai / 1_summary.md
Last active August 18, 2025 17:18
fio tests on aws instances

Summary: Fio tests

r5.2xlarge

r5.2xlarge instance in eu-west-1 with 200 GB EBS io1 volume and 3000 IOPS.

@MaZderMind
MaZderMind / ConnectionHandler.java
Last active January 30, 2025 22:21
Example of a Nonblokcing Socket-Server with java.nio which reads Input Line-by-Line.
package de.mazdermind;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
@jasonkeene
jasonkeene / go-intro.md
Last active May 25, 2019 18:28
Notes for the Programming Languages Club session on Go

Go is an imperative, compiled, statically-typed, garbage-collected, concurrent, general purpose programming language. It emphasizes fast compilation, fast execution, and a conservative, simple language design.

What is Go good for?

Server Software

Go has modern, native implementations of many networking protocols.

@iffy
iffy / results.txt
Created November 5, 2018 16:22
Small, probably non-representative benchmark of JSON Changelog with SQLite https://blog.budgetwithbuckets.com/2018/08/27/sqlite-changelog.html
python testsqlite.py 10000 :memory: 0
6.65568494797 seconds to do 10000 records db=:memory:, triggers=False
6.66251087189 seconds to do 10000 records db=:memory:, triggers=False
6.69321203232 seconds to do 10000 records db=:memory:, triggers=False
python testsqlite.py 10000 :memory: 1
6.76699709892 seconds to do 10000 records db=:memory:, triggers=True
6.82708096504 seconds to do 10000 records db=:memory:, triggers=True
6.82913088799 seconds to do 10000 records db=:memory:, triggers=True