Skip to content

Instantly share code, notes, and snippets.

The status is always bike

Will Speak iwillspeak

The status is always bike
View GitHub Profile
View wordexp_test.c
#include <wordexp.h>
#include <stdio.h>
void expand_word(const char * word) {
wordexp_t words = {0};
wordexp(word, &words, WRDE_NOCMD);
View Lexer.cpp
#include <string>
#include <iostream>
#define CAPTURE_TOKEN(t) \
token->value = std::string(ts, te-ts); \
token->type = Token::t
machine ExampleLexer;
iwillspeak / SampleGreeter.leet
Created Nov 2, 2012
Sketch of the class syntax for Leet
View SampleGreeter.leet
module sample
import io
* Greeting class.
* Stores a list of greetings and prints them to the
* screen upon request
iwillspeak / hello.s
Last active Oct 12, 2015
Hello World in Assembly, OS X
View hello.s
/* compile with clang -m32 */
.global _main
pushl %ebp
movl %esp, %ebp
/* we need to access data relative to the instruction pointer in OS X.
* This register is not readable in 32 bit mode so this trick is needed */
iwillspeak / bytes.c
Created Nov 11, 2012
HHD Byte Count
View bytes.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <inttypes.h>
#define BLOCK_SIZE (4096 * 1024)
typedef struct {
uint8_t byte;
iwillspeak / euler12.wren
Created Oct 25, 2015
Another Implementation of the Solution to Project Euler 12
View euler12.wren
class Euler12 {
construct new(cutoff) {
_cutoff = cutoff
find_divisors(n) {
var nod = 0
var sqrt = n.sqrt.floor
iwillspeak / cargo.toml
Last active Oct 25, 2015
Now Slightly Less Hacky Brute Force of Projec Euler 12 in Rust
View cargo.toml
name = "euler12"
version = "0.1.0"
name = "euler12"
path = ""
iwillspeak /
Created Jan 23, 2013
Grassmannian unit test generation script
#! /usr/bin/env python
import random
import string
import mdp
def foo():
return random.sample(xrange(255), 32)
def bar(n):
ret = []
iwillspeak / strfind.cpp
Created Mar 11, 2013
C++ Program to find a string in a file. Use `strfind file text` to search for <text> in <file>
View strfind.cpp
extern "C" {
#include <sys/mman.h>
#include <fcntl.h>
#include <cstring>
#include <cerrno>
#include <iostream>
int main(int argc, char* argv[]) {
iwillspeak / .snooper.yaml
Last active Dec 15, 2015
Example Snooper configuration file
View .snooper.yaml
# Snooper configuration file
# This is YAML
base_path: .
# default to watching the whole tree
# watch lex, c, and makefiles.
filters: [\.l$, \.c$, \.h$, \.mk$]