To install this:
$ pip install getgist pyyaml && getgist miraculixx markup.py && alias markup="python markup.py"
Then use it from your Python code
from markup import markup
data = markup(file_or_str)
Is that what God does? | |
He helps? | |
Tell me, | |
why didn't God help | |
my innocent friend | |
who died for no reason | |
while the guilty roam free? | |
Okay, fine. | |
Forget the one-offs. | |
How about the countless wars |
# (c) miraculixx, licensed as by the terms of WTFPL, http://www.wtfpl.net/txt/copying/ | |
# License: DO WHATEVER YOU WANT TO with this code. | |
# | |
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
# | |
from io import StringIO | |
from contextlib import contextmanager |
To install this:
$ pip install getgist pyyaml && getgist miraculixx markup.py && alias markup="python markup.py"
Then use it from your Python code
from markup import markup
data = markup(file_or_str)
# to avoid Last login blah | |
# touch .hushlogin | |
# https://scriptingosx.com/2019/07/moving-to-zsh-06-customizing-the-zsh-prompt/ | |
PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{235}%2~%f%b %# ' | |
# case insensitive path-completion | |
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' | |
# partial completion suggestions |
from cgi import parse_qs | |
from wsgiref.simple_server import make_server | |
def simple_app(environ, start_response): | |
status = '200 OK' | |
headers = [('Content-Type', 'text/plain')] | |
start_response(status, headers) | |
if environ['REQUEST_METHOD'] == 'POST': | |
request_body_size = int(environ.get('CONTENT_LENGTH', 0)) | |
request_body = environ['wsgi.input'].read(request_body_size) |
<!doctype html><!-- This is a valid HTML5 document. --> | |
<!-- Screen readers, SEO, extensions and so on. --> | |
<html lang="fr"> | |
<!-- Has to be within the first 1024 bytes, hence before the <title> | |
See: https://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#charset --> | |
<meta charset="utf-8"> | |
<!-- Why no `X-UA-Compatible` meta: https://stackoverflow.com/a/6771584 --> | |
<!-- The viewport meta is quite crowded and we are responsible for that. | |
See: https://codepen.io/tigt/post/meta-viewport-for-2015 --> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> |
<!doctype html><!-- This is a valid HTML5 document. --> | |
<!-- Screen readers, SEO, extensions and so on. --> | |
<html lang=fr> | |
<!-- Has to be within the first 1024 bytes, hence before the <title> | |
See: https://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#charset --> | |
<meta charset=utf-8> | |
<!-- Why no `X-UA-Compatible` meta: https://stackoverflow.com/a/6771584 --> | |
<!-- The viewport meta is quite crowded and we are responsible for that. | |
See: https://codepen.io/tigt/post/meta-viewport-for-2015 --> | |
<meta name=viewport content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no"> |
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c | |
[metadata] | |
name = {name} | |
version = {version} | |
author = Martin Larralde | |
author-email = martin.larralde@ens-paris-saclay.fr | |
home-page = https://github.com/althonos/{name} | |
description = {description} | |
long-description = file: README.rst, CHANGELOG.rst |
Given a folder containing CommonMark files, turn it into HTML.
This guide explains how to set up Kerberos authentication for an HTTP service on a corporate network based on Active Directory.
All instructions will use the following placeholders:
COMPANYAD.COM
: Windows DomainCOMPANYAD
: NETBIOS Domaincompanyad.com
: network domain