Skip to content

Instantly share code, notes, and snippets.

View jonathanrobie's full-sized avatar

Jonathan Robie jonathanrobie

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jonathanrobie on github.
  • I am jonathanrobie (https://keybase.io/jonathanrobie) on keybase.
  • I have a public key ASBEwtg7GqdZjLqro8C1NVsdbS3K6aWEnsohBk0DfjXrQgo

To claim this, I am signing this object:

@jonathanrobie
jonathanrobie / nfkc.py
Created June 27, 2018 16:54
Convert files to Unicode (NFKC)
#!/usr/bin/env python3
import unicodedata
import fnmatch
import sys
import os
for file in os.listdir('.'):
for arg in sys.argv:
if fnmatch.fnmatch(file, arg):
declare variable $Nestle1904.lowfat := doc("macula/GNT/Nestle1904/lowfat/nestle1904lowfat.xml");
declare function local:sentence($node)
{
for $n in $node
return $n/ancestor::sentence/p ! (milestone/text(), ./text())
,
$node
};
@jonathanrobie
jonathanrobie / andiinput.xq
Created December 8, 2021 12:42
Convert OSHB to input file for Andi's HPSG parser
declare function local:morph-string($b, $c, $v, $w, $m, $morph)
{
concat(
$morph,
"_",
format-integer($b,'00'),
format-integer($c,'000'),
format-integer($v,'000'),
format-integer($w, '000'),
format-integer($m, '0'),
@jonathanrobie
jonathanrobie / preorder.py
Created February 9, 2024 19:21
Preorder traversal of a tree
def dfs_preorder_path(root, start, end, path=[], in_range=False, found=[False, False]):
"""
Perform a DFS to find the path from start to end including all nodes in between
in a pre-order traversal manner.
"""
if root is None:
return []
# Check if we have found the start node
if root['id'] == start:
@jonathanrobie
jonathanrobie / Syllables.md
Created February 28, 2024 17:39
Syllables.md

Given the complexity of analyzing Hebrew text with nikkud (vowel pointing) and cantillation (trope marks, which indicate how the text is to be chanted), let's proceed with a more detailed analysis of the first sentence from your text. This analysis will focus on syllable division, stress (stressed vs. unstressed), and whether each syllable is open or closed. Hebrew stress typically falls on the last or penultimate syllable, often influenced by the cantillation marks.

For an accurate analysis, we'll consider only the first sentence due to the detailed nature of this work. The sentence is:

וַיְהִי בִּימֵי שְׁפֹט הַשֹּׁפְטִים וַיְהִי רָעָב בָּאָרֶץ

This sentence can be broken down as follows (note that Hebrew is read right to left):

  1. וַיְהִי (vay'hi) - [va-y'hi] - Stressed (last syllable), Open
  • וַי- (va-y) - Unstressed, Open
@jonathanrobie
jonathanrobie / slack-issue-tracker.md
Created March 27, 2024 19:05
Revolutionizing Productivity: A Bold Move to Slack for Issue Tracking

Title: "Revolutionizing Productivity: A Bold Move to Slack for Issue Tracking"

Dear Team,

In our relentless pursuit of peak efficiency and groundbreaking innovation, we propose a transformative approach to issue tracking: migrating entirely to Slack. Imagine, if you will, a world where the tranquil silence of focused work is a relic of the past, replaced by the vibrant symphony of constant notifications. Here's why this is a brilliant idea:

The Power of Interruption: Boosting Creativity One Ping at a Time

Firstly, let's address the elephant in the room: the immense value of interrupting people. Traditional wisdom suggests that uninterrupted work periods are critical for deep thought and creativity. We dare to challenge this notion! Our philosophy hinges on the belief that true creativity is sparked not in the quiet moments of reflection but in the bustling chaos of relentless Slack notifications. Why settle into a task when you can be jolted to brilliance by an unexpected ping?

@jonathanrobie
jonathanrobie / DBLMetadata.xml
Created May 7, 2024 12:53
John Mark's example
<?xml version=“1.0” standalone=“yes”?><DBLMetadata version=“2.2.1” id=“555fef9a6cb31151" revision=“12”>
<identification>
<name>CEV Revised 2006 (Global CEV)</name>
<nameLocal>CEV Revised 2006</nameLocal>
<description>English: CEV Revised 2006 (Global CEV)</description>
<descriptionLocal>English: CEV Revised 2006 (Global CEV)</descriptionLocal>
<abbreviation>CEVUS06</abbreviation>
<abbreviationLocal>CEVUS06</abbreviationLocal>
<scope>Bible with Deuterocanon</scope>
<dateCompleted>2006-12-01</dateCompleted>
import os
import xml.etree.ElementTree as ET
import json
def parse_xml_file(file_path):
""" Parse an XML file and return needed metadata as a dictionary. """
tree = ET.parse(file_path)
root = tree.getroot()
data = {

Here is a phrase-based interlinear for the provided text:


\s1 (1) ການ/ຝຶກຝົນ/ຂອງ/ດານີເອນ/ໃນ/ບາບີໂລນ
(2) kan/fuekfon/khong/Daniel/nai/Babilon
(3) training of Daniel in Babylon
(4) N/A (Title)