Skip to content

Instantly share code, notes, and snippets.

View iwillspeak's full-sized avatar
🚲
The status is always bike

Will Speak iwillspeak

🚲
The status is always bike
View GitHub Profile
@iwillspeak
iwillspeak / aliases.ini
Last active April 11, 2017 10:16
Git Config Sections
[alias]
stat = status -sb
graph = log --oneline --decorate --graph --topo-order
desc = log -1 --decorate
leaderboard = shortlog -sne
sync = !git pull --rebase && git push
[push]
default = simple
#include <string>
#include <iostream>
#define CAPTURE_TOKEN(t) \
token->value = std::string(ts, te-ts); \
token->type = Token::t
%%{
machine ExampleLexer;
@iwillspeak
iwillspeak / .gitignore
Last active December 11, 2020 11:50
A Microcrate containing an example hand-written lexer.
target
@iwillspeak
iwillspeak / cargo.toml
Last active October 25, 2015 10:44
Now Slightly Less Hacky Brute Force of Projec Euler 12 in Rust
[package]
name = "euler12"
version = "0.1.0"
[[bin]]
name = "euler12"
path = "euler12.rs"
@iwillspeak
iwillspeak / euler12.wren
Created October 25, 2015 10:43
Another Implementation of the Solution to Project Euler 12
class Euler12 {
construct new(cutoff) {
_cutoff = cutoff
}
find_divisors(n) {
var nod = 0
var sqrt = n.sqrt.floor
@iwillspeak
iwillspeak / Time.cs
Created July 5, 2016 08:39
Thoughts on Time
abstract class TZ
{
public abstract TimeSpan UTCOffset { get; }
}
sealed class BST : TZ
{
public override TimeSpan UTCOffset => TimeSpan.FromHours(1);
}
@iwillspeak
iwillspeak / Cargo.toml
Created September 3, 2016 17:49
Simple Pratt-style Parsing in Rust
[package]
name = "parsetest"
version = "0.1.0"
authors = ["Will Speak <[email protected]>"]
[dependencies]
[[bin]]
name = "parsetest"
path = "main.rs"
@iwillspeak
iwillspeak / LLVM From Rust.md
Last active November 2, 2024 06:27
Example of using LLVM from Rust

An Example of Using LLVM from Rust

This example compiles a simple function using the LLVM C API through the llvm-sys crate.

@iwillspeak
iwillspeak / steps.rs
Created January 31, 2017 20:46
Steps
#![feature(inclusive_range_syntax)]
/// Steps At
///
/// Returns the number of combinations of steps which can be made
/// where the top step is a given size. This is used as the recursive
/// step.
///
/// # Arguments
///
@iwillspeak
iwillspeak / Cargo.toml
Created February 25, 2017 15:24
Yop Yop Yop
[package]
name = "yop"
version = "0.1.0"
authors = ["Will Speak <[email protected]>"]
[dependencies]
[[bin]]
name = "yop"
path = "yop.rs"