Skip to content

Instantly share code, notes, and snippets.

View 0atman's full-sized avatar
🦀
Oxidising

Tristram Oaten 0atman

🦀
Oxidising
View GitHub Profile
@0atman
0atman / siberspace.js
Created June 25, 2024 15:14
The source code to my track 'siberspace'
setcps(130/60/4)
samples('shabda/speech/fr-FR/f:Governments of the Industrial World')
samples('shabda/speech/fr-FR/f:you weary giants of flesh and steel')
samples('shabda/speech/fr-FR/f:aï come from saïberspace')
samples('shabda/speech/fr-FR/f:the new home of Maïnd.')
samples('shabda/speech/fr-FR/f:On behalf of the future')
samples('shabda/speech/fr-FR/f:aï ask you of the past')
samples('shabda/speech/fr-FR/f:to leave us alone')
@0atman
0atman / configuration.nix
Last active June 8, 2024 11:53
For people who just don't care about reproducibility, and just want a quiet life. Like me!
programs = {
steam.enable = true;
nix-ld = {
enable = true;
libraries = with pkgs; [
zlib
openssl
curl
# etc
];
@0atman
0atman / benchmark.md
Last active May 22, 2024 09:44
My standard 'install a specific ripgrep' benchmark, now with hyperfine and zero install with nix

With Rust and Hyperfine installed natively

(through https://rustup.rs)

hyperfine --warmup=1 'cargo install -f ripgrep@14.1.0'

Without installation on any machine with Nix

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0atman
0atman / configuration.nix
Last active July 15, 2024 11:26
A rebuild script that commits on a successful build
{
config,
pkgs,
options,
...
}: let
hostname = "oatman-pc"; # to alllow per-machine config
in {
networking.hostName = hostname;
#![allow(dead_code, unused_variables)]
fn main() {}
struct Machine<State> {
data: Vec<u16>,
state: State,
}
struct State1 {}
struct State2 {}
@0atman
0atman / PR-Template.md
Created December 4, 2023 09:17
I'd love to learn more about git-native issues and projects, though my first thought is that if they're stored in markdown, you can build them in whatever editors you would like! Here's a mockup

head: 0atman:branch-name-with-your-changes assignee: 0atman base: local-branch-name-on-this-repo draft: true issue: linked issue url? reviewers:

  • 0atman
  • user2
  • user3
@0atman
0atman / scoped_threads.rs
Last active March 13, 2024 11:05
Unlike non-scoped threads, scoped threads can borrow non-'static data, as the scope guarantees all threads will be joined at the end of the scope.
use std::thread;
struct User {
age: u16,
}
fn simple_thread() {
let user = User { age: 30 };
// thread::spawn(|| &user); // can't borrow `user` as thread may outlive current function
thread::spawn(|| user); // can only move into thread, then it's gone.
use rand_derive2::RandGen;
use rand::random;
fn main() {
println!("Hey, world! 👻 3spoopy5me");
let some_rooms: Vec<Room> = (1..=5)
.map(|n| Room {name: "empty room".into(), next_room: vec![], item: random()})
.collect();
let room = Room {
@0atman
0atman / typer.rs
Created June 12, 2022 08:39
Auto-typer from Lost Terminal
use std::fs;
use std::io::{self, BufRead, Write};
use std::{thread, time};
/// stdout readline implementation
fn wait() {
io::stdin().lock().lines().next();
}
/// Type the script at 300wpm