Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
#
# Copyright 2021 Matt Fleming
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@tivrfoa
tivrfoa / bottlebench.py
Created October 28, 2021 18:00 — forked from grantjenks/bottlebench.py
Server-side I/O Performance in Python
"""Server-side I/O Performance in Python
Based on the article and discussion at:
https://www.toptal.com/back-end/server-side-io-performance-node-php-java-go
The code was posted at:
https://peabody.io/post/server-env-benchmarks/
@tivrfoa
tivrfoa / gist:23a05bb3fa5ab87f1fda5de863951519
Created April 16, 2022 10:28 — forked from WJWH/gist:f3a196e65fdabd6eace5f89da430600e
Server that does no syscalls for handling connections
// Extremely hacky server program that will send a standard response
// to every client that connects, then closes the connection. Will
// issue no system calls (as measured by `strace`) after initial setup
// no matter how many requests are served.
// Yes, this program is sorely lacking in error checking. It's a toy
// and not meant to be taken seriously.
// compile with gcc no_syscall_server.c -luring
@tivrfoa
tivrfoa / HotSpot JVM intrinsics
Created July 9, 2022 10:50 — forked from apangin/HotSpot JVM intrinsics
HotSpot JVM intrinsics
_hashCode java/lang/Object.hashCode()I
_getClass java/lang/Object.getClass()Ljava/lang/Class;
_clone java/lang/Object.clone()Ljava/lang/Object;
_dabs java/lang/Math.abs(D)D
_dsin java/lang/Math.sin(D)D
_dcos java/lang/Math.cos(D)D
_dtan java/lang/Math.tan(D)D
_datan2 java/lang/Math.atan2(DD)D
_dsqrt java/lang/Math.sqrt(D)D
_dlog java/lang/Math.log(D)D
@tivrfoa
tivrfoa / gourcevideo.sh
Created July 16, 2022 12:50 — forked from Gnzlt/gourcevideo.sh
Gource video export command
#!/bin/bash
gource \
-s .03 \
-1280x720 \
--auto-skip-seconds .1 \
--multi-sampling \
--stop-at-end \
--key \
--highlight-users \
@tivrfoa
tivrfoa / Dockerfile
Created September 25, 2022 10:11 — forked from GavinRay97/Dockerfile
OpenJDK build environment
FROM quay.io/fedora/fedora:38
# Install requirements for building OpenJDK from source
RUN dnf install -y \
file \
diffutils \
alsa-lib-devel \
cups-devel \
fontconfig-devel \
freetype-devel \
@tivrfoa
tivrfoa / pizza_delivery.rs
Created October 12, 2022 19:48 — forked from robert-king/pizza_delivery.rs
kickstart pizza delivery
/*
@robertkingnz
https://www.youtube.com/c/RobertKing/videos -> https://youtu.be/Z5WzJ9jbnKg
https://codingcompetitions.withgoogle.com/kickstart/round/00000000008cb0f5/0000000000ba86e6
*/
extern crate core;
fn calc_toll(c: i64, toll: &(char, i64)) -> i64 {
let ans = match toll.0 {

Building my first Quarkus Extension

Quarkus extensions enhance your application just as projects dependencies do. The role of the extensions is to do all the technical piping to make third-party libraries/technologies Quarkus-compatible. This is how you can use your battle-tested ecosystem and take advantage of Quarkus perfomance and native compilation

Prerequisites

To complete this guide, you need:

@tivrfoa
tivrfoa / instructions.md
Created March 16, 2024 01:42 — forked from matthewjberger/instructions.md
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@tivrfoa
tivrfoa / comp_multi.rs
Created January 12, 2025 10:13 — forked from kepler-5/comp_multi.rs
Python comprehension proc macro that handles multiple nested for-if-clauses, flattening nested structure
// Python comprehension proc macro that handles multiple nested for-if-clauses, flattening nested structure.
// Example:
//
// let vec_of_vecs = vec![vec![1, 2, 3], vec![4, 5, 6]];
//
// let result = comp![x for vec in vec_of_vecs for x in vec].collect::<Vec<_>>();
// assert_eq!(result, [1, 2, 3, 4, 5, 6]);
//
use proc_macro2::TokenStream as TokenStream2;