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
@elsanussi-s-mneina
elsanussi-s-mneina / vanilla_js_html5_audio_playback_example.html
Created August 19, 2020 21:12
example of playing audio in HTML5 and Javascript
<!-- Source: https://github.com/elsanussi-s-mneina -->
<!-- LICENSE:
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
@elsanussi-s-mneina
elsanussi-s-mneina / arabic_buckwalter_romanization_using_linux_sed_command
Created November 18, 2020 22:05
sed script for Arabic romanization (Buckwalter)
# Made by Elsanussi Mneina on November 18th, 2020
# Anyone may use.
# It implements the Buckwalter transliteration system, where every Arabic Character corresponds to exactly one latin ASCII character.
# Useful web pages I used when making this code this code:
# How to escape single quotes: https://stackoverflow.com/questions/1250079/how-to-escape-single-quotes-within-single-quoted-strings
# To learn about the Buckwalter tranliteration system see: http://www.qamus.org/transliteration.htm
# https://www.tutorialspoint.com/sed/sed_basic_commands.htm
# If you need to read a file, replace the "echo" part of the command with a call to cat.
@elsanussi-s-mneina
elsanussi-s-mneina / how_to_swap_shift_and_unshifted_number_row_on_kinesis_advantage2.txt
Created January 29, 2021 20:13
If you have a Kinesis Advantage keyboard, add this to your qwerty.txt or dvorak.txt file to swap 1 with its shifted value (usually !), and the other numerals on that row.
* The following are changes to the number row:
* swap numeral one and exclamation mark.
{1}>{speed4}{-lshift}{1}{+lshift}
{lshift}{1}>{speed4}{1}
{rshift}{1}>{speed4}{1}
* swap numeral two and its shifted value.
{2}>{speed4}{-lshift}{2}{+lshift}
{lshift}{2}>{speed4}{2}
{rshift}{2}>{speed4}{2}
@elsanussi-s-mneina
elsanussi-s-mneina / gist:fbecddb00a7e122c0b49017033400a6d
Created January 30, 2021 00:45
kinesis advantage 2 dvorak.txt
* This gist is released into the public domain in accordance with the Unlicense. See unlicense.org.
* Originally released onto github.com/elsanussi-s-mneina on January 29, 2020
* This is a key layout modification of Kinesis Advantage 2 keyboard, which is a hardware keyboard.
* Last edited on January 29, 2020
* Explanation:
* When I first used the Kinesis Advantage 2 keyboard, I kept it on the QWERTY setting.
* I used the Dvorak layout by changing the keyboard layout on the operating system instead.
* This is because many foreign language keyboards would be scrambled if I was on the DVORAK hardware setting.
@elsanussi-s-mneina
elsanussi-s-mneina / buckwalter.go
Created August 12, 2021 21:36
Converting Arabic script to ASCII using buckwalter system, this was a Go programming exercise for me
/*
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 SOFTWARE OR THE U
This file has been truncated, but you can view the full file.
package main
// 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 Go compiler.
// 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 (
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.
@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
@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