Skip to content

Instantly share code, notes, and snippets.

View fhightower's full-sized avatar
🎯
Focusing

Floyd fhightower

🎯
Focusing
View GitHub Profile
@fhightower
fhightower / tiddly_wiki.py
Created August 14, 2019 12:20
Making requests to tiddlywiki
"""Code showing how to create a tiddler in tiddly wiki using python. I was not able to get this working without the "X-Requested-With" header."""
import requests
TIDDLY_WIKI_URL = 'https://localhost:8080'
TIDDLY_WIKI_REQUEST_HEADERS = {
# this "X-Requested-With" header is the key to making these requests work
'X-Requested-With': 'TiddlyWiki',
'Content-Type': 'application/json'
}
@fhightower
fhightower / rcc_and_luther_baptism_logic_validator.pl
Last active January 14, 2020 02:09
Validation of the logic behind affirmations on the Roman Catholic Church's and Luther's teaching on baptism
/* You can test this code here: https://swish.swi-prolog.org/example/examples.swinb */
x('Baptism is necessary for salvation in most cases').
teaches(rcc, x).
teaches(luther, x).
false(x).
falseTeacher(N) :- teaches(N, X), false(X).
/* ?- falseTeacher(luther). (returns: true) */
/* ?- falseTeacher(rcc). (returns: true) */
@fhightower
fhightower / type_hints_to_english.py
Last active February 23, 2021 22:23
Convert python type hints to plain english
def _get_name(ele):
if hasattr(ele, '_name'):
return ele._name
else:
return ele.__name__
def f(a):
# todo: handle optional
# todo: handle union