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 / 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)

;; 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)
@rdhyee
rdhyee / GITenberg_basics.ipynb
Last active February 16, 2016 20:12
List of repositories in https://github.com/gitenberg as of 2016.02.12
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jddurand
jddurand / luaMarpa.sh
Last active June 21, 2017 18:36
Marpa/LUA bindings proof of concept
#!env sh -v
#
# Marpa in Lua proof of concept - Assumption: Debian/Linux
#
# Prologue: apt-get -t unstable install lua5.1 liblua5.1-dev swig
#
# Please go to Marpa-R2-2.096000/engine/read_only and execute this file
# ---------------------------------------------------------------------
#
[ -r ./Makefile ] && make distclean
@jddurand
jddurand / xml_1_0.marpa.bnf
Created June 2, 2014 20:22
W3C EBNF to Marpa using Marpa
inaccessible is ok by default
:start ::= document
AttDef ::= S Name S AttType S DefaultDecl
AttDef_any ::= AttDef *
AttType ::= StringType
AttType ::= TokenizedType
AttType ::= EnumeratedType
AttValue ::= _Lex030 _Gen060_any _Lex030
AttValue ::= _Lex032 _Gen063_any _Lex032
@jddurand
jddurand / EBNF-ISO_IEC_14977_1996_E.pl
Created May 28, 2014 22:24
Marpa grammar of official EBNF ISO/IEC 14977:1996(E)
#!env perl
# -----------------------------------------------------------------------------------------
# Marpa grammar for EBNF published by ISO/IEC 14977:1996(E)
#
# Extensions are minor, and ONLY because our keyboards are more likely to expose Latin-1
# character rather than the Windows-1252 characters as per the spec, i.e.:
#
# Extension 1: Add ' to quoted strings (ISO published the special neighbour character ’)
# Extension 2: Add ^ to <other character> (ISO published the special neighbour character ˆ)
# Extension 3: Add ` to <other character> (ISO published the special neighbour character ‘)
@xem
xem / codegolf.md
Last active March 22, 2024 15:41
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)

@sharwell
sharwell / Program.cs
Created April 1, 2014 11:24
TreePatternTest in C#
namespace TreePatternTest
{
using System;
using System.Collections.Generic;
using Antlr4.Runtime;
using Antlr4.Runtime.Tree;
using Antlr4.Runtime.Tree.Pattern;
class Program
{
@jddurand
jddurand / MarpaRulesByDepth.pl
Last active June 21, 2017 18:37
Inspect marpa grammar rules by depth
#!env perl
use strict;
use diagnostics;
use Marpa::R2 2.081001;
my $grammar = Marpa::R2::Scanless::G->new({ source => \do {local $/; <DATA>}});
my $fmt = "%5s %-20s %-20s %s\n";
printf $fmt, 'depth', 'ruleName', 'lhsName', 'rhsNames';
foreach (@{rulesByDepth($grammar)}) {
printf $fmt, $_->{depth}, $_->{ruleName}, $_->{lhsName}, join(' ', @{$_->{rhsNames}});
@jddurand
jddurand / perl6advent.day18.with.marpa.pl
Last active June 21, 2017 18:38
Marpa::R2 version of Perl6 Advent Calendar - Day 18 – A Grammar with Duplicate checking Reference: https://perl6advent.wordpress.com/2013/12/18/day-18-a-grammar-with-duplicate-checking/
#!env perl
use strict;
use diagnostics;
use Marpa::R2;
use Encode;
use Carp qw/croak/;
use Data::Section -setup;
# Guess why
# ---------