Skip to content

Instantly share code, notes, and snippets.

View SMotaal's full-sized avatar
🙃
mia

Saleh Abdel Motaal SMotaal

🙃
mia
View GitHub Profile
@SMotaal
SMotaal / README.md
Last active January 13, 2022 17:00
Markup Definitions

Markup

Primitives

Grammar

A grammar is a declarative primitive representing the finite sets of rules and symbols of a given language.

Rule (or Production)

@SMotaal
SMotaal / README.md
Last active January 6, 2022 15:55
The Farley BNF Parser

Farley

A template-based BNF parser inspired by [@kach/nearly][].

Nearley

I'm starting by cleaning up the nearly/nearly.js source code.

export class Rule {
@SMotaal
SMotaal / README.md
Last active October 4, 2021 15:51
smotaal.io/experiments/github/gist

smotaal.io/experiments/github/gist

This experiment demonstrates using a GitHub Gist to track and statically stage experimental code through a GitHub Pages.

Please refer to @SMotaal/experiments for more details.

@SMotaal
SMotaal / grid.html
Created November 14, 2020 13:48
smotaal.io/experimental/psychometrics/teq/
<html>
<head>
<title>SMotaal's TEQ</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<meta name="theme-color" content="#262f36" />
<meta name="background-color" content="#999999" />
<link rel="stylesheet" href="/markout/styles/fonts/iosevka.css" />
<link rel="stylesheet" href="/markout/styles/root.css" />
@SMotaal
SMotaal / benchmark.js
Created October 19, 2020 18:14
Benchmark: Inline Closures vs. Nested Functions
export default (class {
MakeInlineClosure() {
const messages = [];
return (message => { { messages.push(message); } });
}
['InlineClosure (ahead-of-time)'] = ({MakeInlineClosure, InlineClosure = MakeInlineClosure()} = this) => () => InlineClosure('test');
['InlineClosure (just-in-time)'] = ({MakeInlineClosure} = this) => () => MakeInlineClosure()('test');
@SMotaal
SMotaal / README.md
Created June 9, 2020 14:28
Emojipedia® Apple iOS 13.3

Emojipedia® Apple iOS 13.3

  1. Navigate to https://emojipedia.org/apple/ios-13.3/

  2. Generate the asset manifest by running:

    copy(JSON.stringify(Object.fromEntries([...document.querySelector('ul.emoji-grid').querySelectorAll('img[title][src][srcset]')].map(({title, attributes}, index) => ([attributes.title.value, attributes.srcset.value.replace(/ +\dx$/, '')])))))
@SMotaal
SMotaal / README.md
Created May 20, 2020 16:39
How to clean from commits!
  1. Clone the repo

    git clone https://github.com/thecraftman/-badging thecraftman-badging
    
  2. Clean the local history

git filter-branch --force --index-filter "git rm --cached --ignore-unmatch "[README.md](https:"/gist.github.com/thecraftman/README.md" --prune-empty --tag-name-filter cat -- --all

@SMotaal
SMotaal / json-tokenizer-readme.md
Last active May 2, 2020 18:46
Error composing block page

JSON Token Matcher

The Matcher-based tokenizer implementation for JSON.

Progress

  • Contextual Definitions — json-definitions.js

    Structured definitions for keywords, goals, symbols… etc, used by the tokenization process.

@SMotaal
SMotaal / es6.ebnf
Created May 2, 2020 13:34 — forked from avdg/es6.ebnf
ES6 bnf grammer - See https://avdg.github.io/es6.xhtml
/* ebnf file for es 6 - MAY CONTAIN ERRORS / DISAMBIGUITY */
Grammer::= Statement
/* Lexical grammer */
SourceCharacter ::= #x0000-#x10FFFF
InputElementDiv ::= WhiteSpace | LineTerminator | Comment | CommonToken | DivPunctuator | RightBracePunctuator
InputElementRegExp ::= WhiteSpace | LineTerminator | Comment | CommonToken | RightBracePunctuator | RegularExpressionLiteral
InputElementRegExpOrTemplateTail ::= WhiteSpace | LineTerminator | Comment | CommonToken | RegularExpressionLiteral | TemplateSubstitutionTail
InputElementTemplateTail ::= WhiteSpace | LineTerminator | Comment | CommonToken | DivPunctuator | TemplateSubstitutionTail
WhiteSpace ::= "<TAB>" | "<VT>" | "<FF>" | "<SP>" | "<NBSP>" | "<ZWNBSP>" | "<USP>"
This file is part of MXE. See LICENSE.md for licensing information.
Contains ad hoc patches for cross building.
diff --git a/configure.ac b/configure.ac
index 1111111..2222222 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,9 +148,16 @@ if test x"$CCAUX" != x"" ; then
echo $AUXFLAGS_MAK_LINE06 >> $AUXFLAGS_MAK.in