Skip to content

Instantly share code, notes, and snippets.

View tim6her's full-sized avatar

Tim B. Herbstrith tim6her

  • Detecon Consulting Austria GmbH
  • Vienna, Austria, EU
View GitHub Profile
@tim6her
tim6her / hdx_configuration.py.mypy
Last active March 20, 2017 19:03
output of $ mypy hdx/configuration.py --ignore-missing-import
# Commit db7a681
hdx/__init__.py:2: error: Need type annotation for variable
hdx/__init__.py:3: error: Need type annotation for variable
hdx/utilities/path.py:23: error: "module" has no attribute "getabsfile"
hdx/utilities/dictandlist.py:7: error: String argument 1 'T' to TypeVar(...) does not match variable name 'DictUpperBound'
hdx/utilities/dictandlist.py:7: error: "object" not callable
hdx/utilities/dictandlist.py:10: error: Invalid type "hdx.utilities.dictandlist.DictUpperBound"
hdx/utilities/dictandlist.py:22: error: Need type annotation for variable
hdx/utilities/dictandlist.py:55: error: Invalid type "hdx.utilities.dictandlist.DictUpperBound"
@tim6her
tim6her / hdx_data_dataset.py.mypy
Created March 20, 2017 19:22
output of $ mypy hdx/data/dataset.py --ignore-missing-import
# Commit db7a681
hdx/__init__.py:2: error: Need type annotation for variable
hdx/__init__.py:3: error: Need type annotation for variable
hdx/utilities/path.py:23: error: "module" has no attribute "getabsfile"
hdx/utilities/dictandlist.py:7: error: String argument 1 'T' to TypeVar(...) does not match variable name 'DictUpperBound'
hdx/utilities/dictandlist.py:7: error: "object" not callable
hdx/utilities/dictandlist.py:10: error: Invalid type "hdx.utilities.dictandlist.DictUpperBound"
hdx/utilities/dictandlist.py:22: error: Need type annotation for variable
hdx/utilities/dictandlist.py:55: error: Invalid type "hdx.utilities.dictandlist.DictUpperBound"
hdx/facades/__init__.py:1: error: Need type annotation for variable
hdx/__init__.py:2: error: Need type annotation for variable
hdx/__init__.py:3: error: Need type annotation for variable
hdx/utilities/path.py:24: error: "module" has no attribute "getabsfile"
hdx/utilities/dictandlist.py:8: error: String argument 1 'T' to TypeVar(...) does not match variable name 'DictUpperBound'
hdx/utilities/dictandlist.py:8: error: "object" not callable
hdx/utilities/dictandlist.py:11: error: Invalid type "hdx.utilities.dictandlist.DictUpperBound"
hdx/utilities/dictandlist.py:24: error: Need type annotation for variable
hdx/utilities/dictandlist.py:57: error: Invalid type "hdx.utilities.dictandlist.DictUpperBound"
hdx/utilities/dictandlist.py:68: error: Need type annotation for variable
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
from itertools import combinations_with_replacement
from pylatexenc.latex2text import LatexNodes2Text
encoder = LatexNodes2Text()
chars = ((r'\"{o} ', 'ö '),
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
from itertools import combinations_with_replacement
import latexcodec
chars = ((r'\"{o} ', r'{ö} '),
(r'{\"o} ', r'{ö} '),
@tim6her
tim6her / sample2e.html
Created March 25, 2018 08:49
Testing pandoc
<p>This is an example input file. Comparing it with the output it generates can show you how to produce a simple document of your own.</p>
<h1 id="ordinary-text">Ordinary Text</h1>
<p>The ends of words and sentences are marked by spaces. It doesn’t matter how many spaces you type; one is as good as 100. The end of a line counts as a space.</p>
<p>One or more blank lines denote the end of a paragraph.</p>
<p>Since any number of consecutive spaces are treated like a single one, the formatting of the input file makes no difference to LaTeX, but it makes a difference to you. When you use LaTeX, making your input file as easy to read as possible will be a great help as you write your document and when you change it. This sample file shows how you can add comments to your own input file.</p>
<p>Because printing is different from typewriting, there are a number of things that you have to do differently when preparing an input file than if you were just typing the document directly. Quotation marks like “this” have t
@tim6her
tim6her / keep-math.hs
Last active May 19, 2018 11:58
A simple Pandoc filter, that ignores math environments
#!/usr/bin/env runhaskell
-- keep-math.hs
-- (c) 2018, Tim Herbstrith
import Text.Pandoc.JSON
main :: IO ()
main = toJSONFilter ignoreMath
ignoreMath :: Inline -> Inline
ignoreMath (Math InlineMath y) = Str $ "$" ++ y ++ "$"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.