Skip to content

Instantly share code, notes, and snippets.

View lancejpollard's full-sized avatar
😍
Lots of coding

Lance Pollard lancejpollard

😍
Lots of coding
View GitHub Profile
@lancejpollard
lancejpollard / itt-coc.ts
Created December 6, 2023 05:09 — forked from VictorTaelin/itt-coc.ts
ITT-Flavored Calculus of Constructions Type Checker
// A nano dependent type-checker featuring inductive types via self encodings.
// All computation rules are justified by interaction combinator semantics,
// resulting in major simplifications and improvements over old Kind-Core.
// A more complete file, including superpositions (for optimal unification)
// is available on the Interaction-Type-Theory repository.
// Credits also to Franchu and T6 for insights.
// This is a new development, may have bugs (:
// Lists
type List<A> =
@lancejpollard
lancejpollard / soundex.js
Created November 2, 2023 06:05 — forked from shawndumas/soundex.js
Soundex in JavaScript
var soundex = function (s) {
var a = s.toLowerCase().split(''),
f = a.shift(),
r = '',
codes = {
a: '', e: '', i: '', o: '', u: '',
b: 1, f: 1, p: 1, v: 1,
c: 2, g: 2, j: 2, k: 2, q: 2, s: 2, x: 2, z: 2,
d: 3, t: 3,
l: 4,

The lojban I speak

coi ro do mi’e la saski’o tu’a dei cu ve ciksi tu’a lo me mi moi jbobau

Introduction

About this guide

This is a brief introduction to Lojban, a constructed human language. It has a very nice, fun, regular grammar that computers and humans alike can understand easily.

Basic grammar

All Lojban words are either particles (tiny words that help the grammar) or verbs (which tell us how nouns relate).

A Lojban sentence consists of a main verb with a bunch of nouns plugged into it.

A Lojban verb definition looks like this:

@lancejpollard
lancejpollard / lojban-thesaurus.md
Created August 12, 2023 04:20 — forked from lynn/lojban-thesaurus.md
A semantically sorted list of Lojban root words

Lojban Thesaurus

Translated to Markdown from this ancient TeX file. I’m not sure who made the original.

Hover over a link to see the place structure. Click it to view gismu info on Wiktionary.

1 Structures

1.1 Set, group, mass

@lancejpollard
lancejpollard / tarjans.js
Created November 15, 2022 23:18 — forked from HopefulLlama/tarjans.js
JavaScript implementation of Tarjan's strongly connected components algorithm
function Vertex(name) {
this.name = name;
this.index = null;
this.lowlink = null;
this.onStack = false;
this.children = [];
}
function TarjanRunner() {
@lancejpollard
lancejpollard / debruijn.py
Created April 20, 2022 11:36 — forked from rgov/debruijn.py
de Bruijn sequence generator
def deBruijn(n, k):
'''
An implementation of the FKM algorithm for generating the de Bruijn
sequence containing all k-ary strings of length n, as described in
"Combinatorial Generation" by Frank Ruskey.
'''
a = [ 0 ] * (n + 1)
def gen(t, p):
/** By_Sean_Eron_Anderson seander@cs.stanford.edu */
#include <stdbool.h>
#include <stdint.h>
#include <endian.h>
#define CHAR_BIT 8
void Compute_the_sign_of_an_integer() {
/*Compute the sign of an integer*/
@lancejpollard
lancejpollard / logic-gates.js
Created April 17, 2022 03:34 — forked from ianstarz/logic-gates.js
Build up all the logic gates from nand in js
const logicGates = {
nand (a, b) { return !(a && b); },
not (a) { return this.nand (a, a); },
and (a, b) { return this.not (this.nand (a, b)); },
or (a, b) { return this.nand (this.not (a), this.not(b)); },
nor (a, b) { return this.not (this.or (a, b)); },
xor (a, b) { return this.and (this.nand (a, b), this.or(a, b)); },
xnor (a, b) { return this.not (this.xor (a, b)); }
};
@lancejpollard
lancejpollard / unixtime.c
Created April 15, 2022 18:16 — forked from t3hk0d3/unixtime.c
Naive implementation of Unix Timestamp to DateTime conversion
typedef struct _DateTime {
uint16_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t minute;
uint8_t second;
} DateTime;
uint8_t monthDays[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};