Skip to content

Instantly share code, notes, and snippets.

View elsanussi-s-mneina's full-sized avatar

Elsanussi S. Mneina elsanussi-s-mneina

View GitHub Profile
{-
Arabic to Hebrew transliteration app (runs in a web browser, basic demo)
Copyright (C) 2021 Elsanussi Mneina
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
-}
@elsanussi-s-mneina
elsanussi-s-mneina / convertTSVToListOfTuplesExample.elm
Last active October 26, 2021 21:29
Given text separated by tab characters, and new lines. Convert it into a valid Elm list of tuples of String ("List (String, String)
-- An example of converting text in
-- tab separated values
-- into a list of tuples of strings.
-- Written on October 26, 2021
-- by Elsanussi Mneina
import Html exposing (text)
import String
inputText = """
a\tb
@elsanussi-s-mneina
elsanussi-s-mneina / digraphTransliteration_commit4_fixBugThatStoppedTransliteratingAtUnrecognizedCharacter.elm
Last active October 26, 2021 21:50
implementing a table based transliteration system algorithm with support for multigraphs
module Main exposing (..)
import Browser
import Html exposing (Html, Attribute, button, div, text)
import Html.Events exposing (onClick, onInput)
import Html.Attributes exposing (..)
-- LIB
@elsanussi-s-mneina
elsanussi-s-mneina / Unicode14Constants.elm
Created October 20, 2021 04:39
Unicode constants for use in the Elm programming language, delete the one's you don't need.
This file has been truncated, but you can view the full file.
module Unicode14Constants exposing (..)
-- Note: in order to make compile times bearable.
-- delete all the consonants you do not intend to use.
-- based on unicode 14.0.0 according to ucd.nounihan.flat.xml
-- this file is intended to be used when you want to use unicode characters but have trouble
-- rememberbing the specific code point. instead you just copy the constants you need,
-- and refer to them by their more memorable names.
-- do whatever you want with this code. i have not verified it beyond ensuring that it compiles with the elm compiler.
@elsanussi-s-mneina
elsanussi-s-mneina / UnicodeConstants.dart
Created October 20, 2021 04:15
constants for each unicode code point using the Unicode name where possible, and named according to Dart conventions (camel case).
This file has been truncated, but you can view the full file.
// based on unicode 14.0.0 according to ucd.nounihan.flat.xml
// this file is intended to be used when you want to use unicode characters but have trouble
// rememberbing the specific code point. instead you just copy the constants you need,
// and refer to them by their more memorable names.
// do whatever you want with this code. I have not verified it beyond ensuring that it compiles with the Dart compiler.
const nullCharacter = '\u0000'; // Had to change the name because
// null is a reserved word in Dart programming language.
// MIT License:
// Copyright 2021 Elsanussi S. Mneina
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
@elsanussi-s-mneina
elsanussi-s-mneina / buckwalterWebApplication_Commit4_addDemoTextButton.elm
Last active October 20, 2021 05:03
Implementing the Buckwalter transliteration system for a web page (using Elm) (a character to character transliteration)
-- MIT License:
{-
Copyright 2021 Elsanussi S. Mneina
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT
@elsanussi-s-mneina
elsanussi-s-mneina / convert_from_screaming_snake_case_to_camel_case.go
Last active October 3, 2021 17:47
for converting between SCREAMING_SNAKE_CASE and camelCase
// MIT License:
/*
Copyright 2021 Elsanussi S. Mneina
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT
import 'package:flutter/material.dart';
// Programmed by Elsanussi Mneina
// How to run this program.
// If you don't want to install anything,
// 1. Go to dartpad.dev in your web browser.
// 2. Copy all this source code that is here.
// 3. Paste it into the dartpad.dev window replacing
// the source code that is already there.
// Run this in the Go playground
// This is a reimplementation of the parser combinators in the book "Programming in Haskell" by Graham Hutton
// ISBN 978-0-521-69269-4
// This is my interpretation of it using Go instead of Haskell.
// File started on September 29, 2021 by Elsanussi Mneina
package main
import (