Skip to content

Instantly share code, notes, and snippets.

View FauxFaux's full-sized avatar

Chris West FauxFaux

View GitHub Profile
[package]
name = "paper-events"
version = "0.1.0"
edition = "2021"
[dependencies]
anyhow = "1"
itertools = "0.13"
bincode = { version = "2.0.0-rc.3", features = ["derive"] }
rand = "0.8"
use anyhow::Result;
use std::net::SocketAddr;
use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader};
use tokio::net::{TcpListener, TcpStream};
async fn echo(mut socket: TcpStream, addr: SocketAddr) -> Result<()> {
println!("Incoming connection from: {}", addr);
let (read, mut write) = socket.split();
let mut read = BufReader::new(read);
write.write_all(b"Welcome!").await?;
use bitfield_struct::bitfield;
#[bitfield(u8)]
struct Status {
#[bits(4)]
tag: u8,
#[bits(4)]
channel: u8,
}
# Place a copy of this config to ~/.aerospace.toml
# After that, you can edit ~/.aerospace.toml to your liking
# You can use it to add commands that run after login to macOS user session.
# 'start-at-login' needs to be 'true' for 'after-login-command' to work
# Available commands: https://nikitabobko.github.io/AeroSpace/commands
after-login-command = []
# You can use it to add commands that run after AeroSpace startup.
# 'after-startup-command' is run after 'after-login-command'