Skip to content

Instantly share code, notes, and snippets.

View gremerritt's full-sized avatar

Greg Merritt gremerritt

  • Salsify
  • Falmouth, ME
View GitHub Profile
@gremerritt
gremerritt / boat.c
Created July 2, 2018 21:37
boatlang
#include <stdio.h>
#include <regex.h>
#include <string.h>
#include <stdlib.h>
#define NUM_TOKENS_DEFS 10
#define WHITESPACE "WHITESPACE"
typedef struct tokendef {
char *pattern;
@gremerritt
gremerritt / permutator
Last active April 5, 2017 04:15
Run permutations of a program
#!/usr/bin/ruby
require 'pty'
def generate_permutations cmd_template, lists, vars=[]
if lists.empty?
cmd = String.new(cmd_template)
vars.each_with_index { |var, i| cmd.gsub! "{#{i}}", var }
if $preview
puts cmd