a small collection of my favorite projects that I've been working on lately
not to be confused with "stuff i get paid to build" (those aren't as fun)
a plugin intended to bring the spirit of old school runescape into neovim. powered by a blazingly fast Rust backend, batches of your vim keystrokes are processed in the blink of an eye - granting you experience and levels corresponding to different categories of vim motions to track your progress and impress your friends.
Learn Morelexer.rs
impl<'a> Lexer<'a> {
pub fn new(input: &'a str) -> Self {
let chars = input.chars().peekable();
Self {
input: chars,
state: State::None,
accumulated_string: String::new(),
}
}
}
memory_api.rs
pub fn get_owned_rooms() -> Vec {
game::rooms()
.values()
.filter(|room| {
let controller = room.controller();
match controller {
Some(controller) =>
controller.my(),
None => false,
}
})
.collect()
}
a fully fledged, blazingly fast bot written in Rust (compiled into wasm) for the programming MMO, Screeps. from handling spawning, optimizing resource collection and usage, to implementing custom pathfinding to manage creep traffic; there is no shortage of complexity in this 24/7 global world where automation and performance are paramount.
a discord bot, powered by Rust, to protect and enforce the sanctity of the early-birds channel. a place for friends to converge in the early morning, when the worms are the freshest and the air is the crispest. any messages outside of the holy time slot are automatically deleted
Learn Moremain.rs
impl EventHandler for Bot {
async fn message(ctx: Ctx, msg: Message)
if channel_matches(&channel_id) {
let timestamp = msg.timestamp.time();
let hour = timestamp.hour();
if hour < START_UTC || hour >= END_UTC {
let _ = msg.delete(ctx.http).await;
}
}
}
}
app.rs
pub fn get_random_fact() -> String {
let len = FACTS_BANK.len();
let index = thread_rng().gen_range(0..len);
let chosen_fact = FACTS_BANK.get(index);
if let Some(fact) = chosen_fact {
return String::from(*fact);
} else {
return String::from("Fact not found");
}
}
a prototype demonstrating the ability to serve a tui over ssh. cycles through fun facts of a good friend as the interface to prove the concept. written in rust, accessed via ssh krisfacts.jacobwaldrip.com -p 2222. authenticates with public key
a node version manager, but significantly more performant. after profiling my slow shell start up, i noticed `nvm` adding over one thousand milliseconds to my start-up; so i wrote my own in rust
Learn Moremain.rs
match &args.command {
Some(Commands::Install) => {
handle_install_command(
&*install_client,
&mut cmd
);
}
Some(Commands::Current) => {
handle_current_command(&mut cmd);
}
}