Skip to content

Instantly share code, notes, and snippets.

View whitten's full-sized avatar
💭
Looking at code

David Whitten whitten

💭
Looking at code
View GitHub Profile
@whitten
whitten / program.cs
Created February 3, 2022 21:01 — forked from ericewers/program.cs
A Hero's Journey
/*
* A Hero's Journey
* By Eric Ewers, 7-21-2019
*/
using System;
using System.Collections.Generic;
namespace Adventure
{
@whitten
whitten / codegolf.md
Created September 28, 2017 19:55 — forked from xem/codegolf.md
JS code golfing

codegolf JS

Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...

(For more info and other projects, visit http://xem.github.io)

(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)

module type CELL = sig
type 'a cell
type 'a exp
val return : 'a -> 'a exp
val (>>=) : 'a exp -> ('a -> 'b exp) -> 'b exp
val cell : 'a exp -> 'a cell exp
val get : 'a cell -> 'a exp
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, first visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
;; (load "cynd/cb-prolog.lisp")
#+Allegro
(sl::cpushnew :CYC-COMMON-LISP *features*)
#+Allegro
(use-package :CYC)
@whitten
whitten / interpreter2.pl
Created March 20, 2016 08:11 — forked from jeffreykegler/interpreter2.pl
The Gang of 4's second Interpreter Pattern example, rewritten to use Marpa::R2.
#!perl
# Copyright 2013 Jeffrey Kegler
# This file is part of Marpa::R2. Marpa::R2 is free software: you can
# redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# Marpa::R2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@whitten
whitten / gist:e616475066ca733694e1
Created March 20, 2016 07:32 — forked from jeffreykegler/gist:4440418
Gist for blog post announcing Marpa's Scanless interface
#!/usr/bin/perl
# Copyright 2012 Jeffrey Kegler
# This file is part of Marpa::R2. Marpa::R2 is free software: you can
# redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# Marpa::R2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@whitten
whitten / perl6advent.day18.with.marpa.pl
Created March 20, 2016 07:29 — forked from jddurand/perl6advent.day18.with.marpa.pl
Perl 6 advent blog post, adapted to Marpa
#!env perl
use strict;
use warnings FATAL => 'all';
use Marpa::R2;
use Data::Section -setup;
use open ':std', ':encoding(utf8)';
our $DATA = __PACKAGE__->local_section_data;
# Grammar and test suite are in __DATA__
@whitten
whitten / deps.rs
Created March 20, 2016 07:28 — forked from pczarn/deps.rs
Rust: dependency graph
use std::io;
fn main() {
println!("digraph {{");
let mut input = io::stdin();
let mut lines = input.lines();
loop {
match lines.next() {
Some(line) => {
let line = line.unwrap();
let line = line.as_slice();
@whitten
whitten / marpa_error_codes.md
Created March 20, 2016 07:26 — forked from pczarn/marpa_error_codes.md
libmarpa's error codes

Libmarpa 7.3.0 failure return values, for your bindings-writing pleasure

Always succeed.

marpa_check_version
marpa_c_init
marpa_c_error
marpa_r_earley_item_warning_threshold
marpa_r_earley_item_warning_threshold_set