Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am timbod7 on github.
  • I am timbod77 ( on keybase.
  • I have a public key ASByGqS9snO0G55GNTafZo8imOe6NCTOCKJPomdnmB88Hgo

To claim this, I am signing this object:

timbod7 /
Created Jul 3, 2018
maybe create an optional reference inside a map
fn get_or_insert1<'a>(map: &'a mut HashMap<String,String>, key:&String) -> &'a mut String {
map.entry(key.clone()).or_insert_with(|| String::new())
fn get_or_insert2<'a>(map: &'a mut HashMap<String,String>, key:&String) -> &'a mut String {
match map.get_mut(key) {
Some(v) => v,
None => {
timbod7 /
Last active Aug 29, 2015
Setup an Amazon Linux EC2 instance to run codeworld
# Update and install basic dependencies
sudo yum update -y
sudo yum install -y git
sudo yum install -y zlib-devel
sudo yum install -y ncurses-devel
# Needed for ghcjs-boot --dev