Skip to content

Instantly share code, notes, and snippets.

@DanielKeep
DanielKeep / bintree.rs
Created August 2, 2015 14:44
Simple Binary Tree in Rust
use std::fmt;
#[derive(Debug)]
struct BinTree<T>
where T: Ord {
root: Option<Box<BinNode<T>>>,
}
#[derive(Debug)]
struct BinNode<T>
@DanielKeep
DanielKeep / rustup.ps1
Last active August 29, 2015 14:27
rustup for PowerShell
<#
.SYNOPSIS
Downloads Rust installers for Windows.
.DESCRIPTION
Tries to download the latest available release for a given version of the Rust compiler. It does this by checking the date the currently installed compiler was built against the timestamp of the remote installer. These do not always match up, so do not be surprised if this script keeps trying to re-download the same archive.
Once downloaded, provided you specified either 'exe' or 'msi', the script will run the installer for you.
@DanielKeep
DanielKeep / gen-code.py
Created July 22, 2017 13:45
unroll macro
#!/usr/bin/env python3
import sys
if len(sys.argv) != 2:
print('Usage: gen-code.py LIMIT')
sys.exit(1)
LIMIT = int(sys.argv[1])
print(