Skip to content

Instantly share code, notes, and snippets.

View stephanh42's full-sized avatar

Stephan Houben stephanh42

  • Heythuysen, The Netherlands
View GitHub Profile
@stephanh42
stephanh42 / spaces.txt
Created November 17, 2017 15:58
Various outside-the-usual Unicode whitespace characters
U+001C || [FILE SEPARATOR]
U+001D || [GROUP SEPARATOR]
U+001E || [RECORD SEPARATOR]
U+001F || [UNIT SEPARATOR]
U+00A0 | | NO-BREAK SPACE
U+1680 | | OGHAM SPACE MARK
U+2000 | | EN QUAD
U+2001 | | EM QUAD
U+2002 | | EN SPACE
U+2003 | | EM SPACE
@stephanh42
stephanh42 / LICENSE
Last active November 22, 2017 08:04
Check a Python source code if it contains identifiers which are confusable.
MIT License
Copyright (c) 2017 Stephan Houben
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@stephanh42
stephanh42 / freeze.py
Created November 30, 2017 11:32
Convert object into a read-only (frozen) variant. Well, to the extent possible.
from functools import singledispatch
from types import MappingProxyType
@singledispatch
def freeze(obj):
"""Convert obj into a read-only (frozen) variant. Well, to the extent possible."""
""" Example: foo = freeze({"x": [1,2,{3,4}]})
"""
return obj # not much frost today
"""Sine in degrees.
Copyright 2018 Stephan Houben
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT