Skip to content

Instantly share code, notes, and snippets.

☕️
Soap Coffee

Thomas Letan lthms

☕️
Soap Coffee
Block or report user

Report or block lthms

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View func.rs
trait Func<A, B> {
fn apply(&self, x: A) -> B;
}
pub struct Curry<A, B>(Box<Fn(A) -> B>);
impl<A, B> Func<A, B> for Curry<A, B> {
fn apply(&self, x: A) -> B {
(self.0)(x)
}
View Category.v
Require Import Coq.Logic.ProofIrrelevance.
Require Import Coq.Program.Tactics.
Ltac simpl_exist_eq :=
match goal with
| [ |- exist _ ?x _ = exist _ ?y _]
=> let H := fresh "H"
in cut (x = y);
[ intro H;
apply eq_sig with (p:=H);
View simpl_exist_eq.v
Require Import Coq.Logic.ProofIrrelevance.
Require Import Coq.Program.Tactics.
Ltac simpl_exist_eq :=
match goal with
| [ |- exist _ ?x _ = exist _ ?y _]
=> let H := fresh "H"
in cut (x = y);
[ intro H;
apply eq_sig with (p:=H);
View too_much.sql
CREATE TABLE sheets (
id SERIAL PRIMARY KEY,
character_id INTEGER NOT NULL REFERENCES characters,
created TIMESTAMP NOT NULL DEFAULT now(),
validated TIMESTAMP,
current BOOLEAN,
future BOOLEAN,
invalidated TIMESTAMP,
name VARCHAR(80) NOT NULL,
View README.md

ogmarkup

What is ogmarkup?

Typographic rules can be trick to enforce in a consistent manner in a document. In French, typographic rules for dialogues are arguably worst. ogmarkup is part of the so-called ogma-project. It is a minimal domain-specific markup language, intended to free fiction writers from the pain to enforce typographic rules within their productions manually.

View schema.sql
CREATE TABLE entities (
id SERIAL PRIMARY KEY,
time INT4RANGE,
class SMALLINT NOT NULL
);
CREATE TABLE documents (
id SERIAL PRIMARY KEY,
language INT2 NOT NULL,
raw TEXT NOT NULL,
View test_render.rs
#[test]
fn test_render() {
use typography::ENGLISH;
use generator::test::Html;
assert_eq!(
render_galatian_document(r#"It looks like it is working.
+I+
smiled *at
View test_document.rs
#[test]
fn test_document() {
assert_eq!(
document(r#"She opened the letter, and read it.
_____letter____
Dear friend.
I love you.
_______________"#),
View test_paragraph.rs
#[test]
fn test_paragraph() {
assert_eq!(
paragraph("[Hi stranger, this is me.] Indeed.\n\n[Hi]"),
Ok(
(
"\n\n[Hi]",
Paragraph(
vec![
Component::Dialogue(
View test_raw.rs
#[test]
fn test_raw() {
assert_eq!(
raw("Hi stranger, how are you?"),
Ok(
(
"",
Format::Raw(
vec![
Atom::Word("Hi"),
You can’t perform that action at this time.