Skip to content

Instantly share code, notes, and snippets.

View asaaki's full-sized avatar
🦀
Oh crab!

Christoph Grabo asaaki

🦀
Oh crab!
View GitHub Profile
#![warn(rust_2018_idioms)]
#[derive(Debug)]
pub struct StrSplit<'haystack, D> {
remainder: Option<&'haystack str>,
delimiter: D,
}
impl<'haystack, D> StrSplit<'haystack, D> {
pub fn new(haystack: &'haystack str, delimiter: D) -> Self {
@abel0b
abel0b / install-linux-perf-on-wsl2.sh
Last active June 21, 2025 14:57
Install perf on WSL 2
apt install flex bison
git clone https://github.com/microsoft/WSL2-Linux-Kernel --depth 1
cd WSL2-Linux-Kernel/tools/perf
make -j8
sudo cp perf /usr/local/bin
#!/bin/bash
# See https://github.com/codeclimate/test-reporter/issues/226
# And https://github.com/codeclimate/test-reporter/pull/305
export CI_NAME="heroku"
export GIT_COMMITTED_AT="$(date +%s)"
# Run the ruby test suite
bundle exec rake
@twooster
twooster / README.md
Last active April 2, 2020 10:06 — forked from jmhobbs/README.md
Create scrolling text gifs for Slack

(Forked from yolo.sh that works on mac)

Makes little scrolly text jiffs in Flywheel colors.

Prerequisites

  • imagemagick sudo apt install imagemagick
  • gifsicle sudo apt install gifsicle
  • u linux
@andrewloux
andrewloux / numa.md
Last active May 3, 2024 19:16
What is NUMA, and why should Kubernetes users care?

Historically, all memory on x86 architectures were equally accessibly by all CPUs on the system. This is an effective implementation, but there's increased bandwidth on the bus, and the more CPUs you have, the further away from the memory it is. This layout is called Uniform Memory Access.

Older UMA Layout

Modern x86 architectures introuduce the concept of memory nodes (also referred to elsewhere as zones or cells), where new writes are associated with a CPU's memory node. The nodes are connected by a bus, so all the memory is still accessible via any CPU, but of course, we have faster memory access time for CPUs accessing local nodes.

NUMA NUMA Layout

When you have a virtualization layer on top, and you are scheduling workloads, you can take advantage of this by pinning processes to specific CPUs.

@o0Ignition0o
o0Ignition0o / bastion_floating_on_tide1.rs
Created February 23, 2020 09:56
Bastion floating on tide example!
use std::iter;
// in order to determine if n is prime
// we will use a primality test.
// https://en.wikipedia.org/wiki/Primality_test#Pseudocode
fn is_prime(n: u128) -> bool {
if n <= 3 {
n > 1
} else if n % 2 == 0 || n % 3 == 0 {
false
@stettix
stettix / things-i-believe.md
Last active June 19, 2025 02:11
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.

@IanColdwater
IanColdwater / twittermute.txt
Last active June 15, 2025 16:53
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@rust-play
rust-play / playground.rs
Created August 21, 2019 16:56
Code shared from the Rust Playground
// #![feature(async_await)]
// use std::borrow::Cow;
#[derive(Debug)]
struct User {
email: Email,
}
#[derive(Debug, Clone)]
@tatianamac
tatianamac / tatiana-mac-speaker-rider.md
Last active April 22, 2025 22:44
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Last updated 14 April 2021

What is a speaker rider?

As speaking comes with immense privilege, I have crafted a speaker rider to set expectations and boundaries around my engagement. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most historically excluded and marginalised communities.

Considerations

😫 I provide a lot of explanations for those of you who never had to consider these things. Most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.