Skip to content

Instantly share code, notes, and snippets.

Eddie Antonio Santos eddieantonio

Block or report user

Report or block eddieantonio

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 worker-from-function-example.html
<script>
var url = URL.createObjectURL(new Blob(['(', MyWebWorker.toString(), '())'], {
type: 'text/javascript'
}));
console.log(url);
var worker = new Worker(url);
worker.onmessage = function (event) {
console.log("from worker:", event);
}
View await-duration.js
class Duration {
constructor(number) {
this._number = number;
}
valueOf() {
return this._number;
}
then(fn) {
@eddieantonio
eddieantonio / cree-classes.py
Last active Nov 15, 2018
Ideas on how to represent Cree morphological data.
View cree-classes.py
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Some ideas about how to organize data from the FST, to how to store Cree
wordforms.
Usage:
Analyzing a wordform descriptively yields "raw" FST output:
@eddieantonio
eddieantonio / server_start_sigusr1.py
Created Jul 3, 2018
SIGUSR1 to indicate process is ready.
View server_start_sigusr1.py
#!/usr/bin/env python2.7
# -*- coding: UTF-8 -*-
import os
import signal
import sys
from contextlib import contextmanager
from random import randint
from signal import SIGUSR1, SIGTERM
from time import sleep
@eddieantonio
eddieantonio / Makefile
Created Jun 26, 2018
How to create Cans-to-Cans FSTs.
View Makefile
# The source analyser and generator FSTs are done entirely in Standard Roman
# Orthography (Latn). However, we require Canadian Aboriginal syllabics
# versions of both. This Makefile converts SRO FSTs in the equivillent
# syllabics FSTs.
#
# analyser-gt-desc.Cans-to-Cans.hfstol
# : An analyzer that accepts input in Canadian Aboriginal syllabics
# and produces a morphological analysis with its lemma also written in syllabics.
# "Descriptive" means it is able to understand non-standard orthography.
#
@eddieantonio
eddieantonio / .aliases.sh
Created Jun 21, 2018
Linux alternative to pbpaste/pbcopy
View .aliases.sh
# Emulate macOS's pbcopy(1) and pbpaste(1) utilities.
alias xcopy='xclip -selection clipboard'
alias xpaste='xclip -o -selection clipboard'
View blocks2sizes.py
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import sys
from math import log
def size2number(blocks):
number = int(blocks) * 512 # bytes
if number == 0:
return 'empty'
View digital.erl
#!/usr/bin/env escript
-module(digital).
-import(lists, [sum/1]).
-export([main/1, root/1, dr/1]).
main([Number]) ->
Answer = root(list_to_integer(Number)),
io:format("~p~n", [Answer]);
View dice.py
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
A module for dice, dice rolls, and dice arithmetic.
"""
import sys
import re
from types import ModuleType
View edit.py
#!/usr/bin/env python3
from os import execlp, environ
from pathlib import Path
from re import match, search
from subprocess import call
test_file, = tuple(Path('.').glob('*_test.rb'))
stem = match(r'\A(.+)_test[.]rb\Z', str(test_file)).group(1)
impl_file = Path('.') / f"{stem}.rb"
You can’t perform that action at this time.