Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import json
import sys
import dateutil.parser
import gedcom.parser
parser = gedcom.parser.Parser()
parser.parse_file(sys.argv[1], False)
countries = {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
%import common.WS
%ignore WS
ADJ: "big" | "red" | "tall" | "narrow" | "mine" | "blue" | "green" | "large" | "small" | "short" | "little" | "wide"
DET: "that" | "any" | "an" | "a" | "the"
NOUN: "block" | "pyramid" | "box" | "that" | "cube" | "table" | "thing" | "colour" | "object" | "steeple" | "superblock"
PREP: "into" | "onto" | "in" | "on top of" | "on" | "behind"
PREPT: "before" | "while"
VERB: "pick up" | "pick" | "contain" | "support" | "own" | "touch"
DIR: "left" | "right"
@davidar
davidar / prolog.md
Last active March 11, 2022 10:01
Prolog relative clauses

Pointless Prolog

This document proposes relative clauses as syntactic sugar for Prolog, which allow us to write more concisely by avoiding repetitively naming variables. Relative clauses are written as a list of predicates surrounded by curly braces. They introduce a new variable, which is constrained by applying all of the included predicates to it. For example:

{red, block}

is equivalent to the query

a
ᴇᴛʏᴍᴏʟᴏɢʏ: A priori, possibly onomatopoeic
ɪɴᴛᴇʀᴊᴇᴄᴛɪᴏɴ
• (emotion word) ah, oh, uh, ha
ᴘᴀʀᴛɪᴄʟᴇ
• (adds emphasis) ah, yes, really, indeed
ɴᴏᴛᴇꜱ
Often used repeatedly (e.g 'a a a') to signify laughter
akesi
abbreviation
You write some parts but not all parts of a long word. When someone sees what you wrote, they know it means the same as this long word.
ability
What someone can do.
about
Thinking or saying what this thing is, what it does, and what happens to it.
Near.
Around.
A short time before.
Very much like but not the same as and not more than.
Not much more than or much less than.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davidar
davidar / flow.py
Created November 29, 2017 07:50
implementation of http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.7829 for plain lambda calculus
#!/usr/bin/env python3
from util import *
from lam import *
from ty import *
def extract(t, *kind):
if type(t) is Lam:
res = extract(t.args[1], *kind)
if Lam in kind: res.add(t)
if Var in kind: res.add(t.args[0])
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<string.h>
#include<ctype.h>
void handle_args(int argc, char*argv[], char *neg, FILE **fp);
int main(int argc, char*argv[])
{
var jsdom = require("jsdom").jsdom;
var Readability = require("./index").Readability;
var express = require("express");
var app = express();
function removeCommentNodesRecursively(node) {
for (var i = node.childNodes.length - 1; i >= 0; i--) {
var child = node.childNodes[i];
if (child.nodeType === child.COMMENT_NODE) {