Skip to content

Instantly share code, notes, and snippets.

Avatar

Jahan Addison jahan-addison

View GitHub Profile
View example.feature
Feature: Multiple site support
Only blog owners can post to a blog, except administrators,
who can post to all blogs.
Background:
Given a global administrator named "Greg"
And a blog named "Greg's anti-tax rants"
And a customer named "Dr. Bill"
And a blog named "Expensive Therapy" owned by "Dr. Bill"
View tsconfig-2.json
{
"compilerOptions": {
"alwaysStrict": true,
"experimentalDecorators": true,
"module": "es2015",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"noEmitOnError": false,
"jsx": "react",
View definite_clause_grammar.hs
-- https://en.wikipedia.org/wiki/Definite_clause_grammar
-- http://cs.union.edu/~striegnk/learn-prolog-now/html/node59.html#subsec.l7.firstexample
-- This grammar allows sentences like "he likes her" and "he likes him", but not "her likes he" and "him likes him".
sentence --> pronoun(subject), verb_phrase.
verb_phrase --> verb, pronoun(object).
pronoun(subject) --> [he].
pronoun(subject) --> [she].
@jahan-addison
jahan-addison / tsconfig.json
Last active Jun 21, 2020
Jahan Recommended tsconfig.json
View tsconfig.json
{
"compilerOptions": {
"alwaysStrict": true,
"experimentalDecorators": true,
"module": "commonjs",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"noEmitOnError": false,
"strict": true,
View document.md

The Schema Documentation Language

Overview

The language is designed to be entirely agnostic and platform-independent — It is primarily designed as a comment block above javascript and YAML. By building the schema language as a general-purpose compiler, we have full control over syntax or where it can be used and can build documentation or metadata (such as JSON schema) across the board anywhere in our content.

Targets

The schema language may be compiled to more than one target. Currently, it compiles to JSONSchema — but Jekyll and HTML for self-documentation are in the future roadmap.

View patterns_activities_myactivity.yml
myactivity:
metadata:
title: 'Some Great Section'
description: '_____'
tags:
- 'something'
collection:
- 'pages.mypage'
- 'pages.mypage'
- 'pages.mypage'
@jahan-addison
jahan-addison / b.ebnf
Last active Sep 5, 2019
B Language LALR(1) EBNF-like grammar
View b.ebnf
/////////////////////////////////////////////////////////
// B Language Grammar
// Author: Jahan Addison
// LALR(1) EBNF-like Grammar
// Placed under CC0 1.0
/////////////////////////////////////////////////////////
program : ( definition ) *
definition : function_definition
View a.ts
import { ƛ, Connect, server, message, reply, on } from './lib/dsl';
const sandbox = require('sandbox');
const virtual = new sandbox();
ƛ({
server: 'irc.freenode.org',
nick: 'qj2',
channel: '##frontend'
},
@jahan-addison
jahan-addison / a.ts
Last active Dec 21, 2017
DSL in Javascript (Typescript)
View a.ts
ƛ({
server: 'irc.freenode.org',
nick: 'dslbot',
channel: '##dslbottesting'
},
Connect(6667)(
line => on(/PING (\S+)/)(_ => {
server`PONG ${_}`
}),
line => on(/hello/)(_ => {
View matzen.ts
// Copyright (c) 2016, Jahan Addison
// License: MIT
// @version: 1.2.0
type Tuple<T> = [T];
type Pure<T> = (T: T) => T;
type Pattern = string | number;
type Invoker = Pure<Pattern>;
type Val = Tuple<Pattern>;
type Case = boolean;
You can’t perform that action at this time.