Skip to content

Instantly share code, notes, and snippets.

View overhacked's full-sized avatar

Ross Williams overhacked

View GitHub Profile
@overhacked
overhacked / posix_select_example.c
Last active March 5, 2024 21:52
Little C program to find the maximum value of select's timeout
#include <fcntl.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/fcntl.h>
#include <sys/select.h>
/* min and max integer values. T is a signed or unsigned integer type. */
@overhacked
overhacked / recurse_cracklepop.py
Created July 25, 2022 13:25
Recurse Center Application CracklePop
#!/usr/bin/env python3
def main():
for n in range(1, 101):
maybe_crackle = "Crackle" if n % 3 == 0 else ''
maybe_pop = "Pop" if n % 5 == 0 else ''
if maybe_crackle or maybe_pop:
print(maybe_crackle, maybe_pop, sep='')
else:
@overhacked
overhacked / Cargo.toml
Last active October 13, 2020 15:14
warp_question about synthetic delay
[package]
name = "warp_question"
version = "0.1.0"
authors = ["Ross Williams <ross@ross-williams.net>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio = { version = "0.2.22", features = ["full"] }
@overhacked
overhacked / multi-struct-yaml-example.go
Created July 27, 2019 23:40
Idea for multivariant structs in go-yaml (for zrepl)
package main
import (
"fmt"
"log"
"gopkg.in/yaml.v2"
)
// An example showing how to unmarshal embedded