Skip to content

Instantly share code, notes, and snippets.

💭
🔢 👍

Wes Turner westurner

💭
🔢 👍
Block or report user

Report or block westurner

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@westurner
westurner / 010-variables.ipynb
Last active Jun 4, 2018
Python variables, references, aliases, garbage collection, scope
View 010-variables.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@westurner
westurner / site_discover.py
Created Nov 16, 2017
find all python*.exe and pip*.exe binaries on os.environ['PATH']
View site_discover.py
#!/usr/bin/env python
"""
Something like this as e.g site.discover
(for use as ``python -m site.discover``)
could be helpful for explaining and diagnosing multiple pythons and pips
"""
import os
import re
from distutils.spawn import find_executable
View search_python_operators.py
def search_operators(str_):
matches = []
for thing in [[x, getattr(int, x).__doc__] for x in dir(int) if x.startswith('__')]:
print((">>>>", (thing[0], thing[1])))
if thing[1] is not None and "<==>" in thing[1]:
print(('<==>', thing[1].split(" <==> ")[::-1]))
if str_ in thing[1]:
matches.append(thing)
print('')
@westurner
westurner / parse_inputrc.py
Last active Sep 19, 2016
parse a readline .inputrc file with Python
View parse_inputrc.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
"""
parse_inputrc -- parse a readline .inputrc file
.. note:: This probably only handles a subset of ``.inputrc`` syntax.
"""
View onenamegist+westurner.txt
Verifying that +westurner is my blockchain ID. https://onename.com/westurner
@westurner
westurner / loglevels.py
Created Feb 15, 2016
loglevels.py: logging._levelNames { (0) NOTSET ; (10) DEBUG ; (20) INFO ; (30) WARN / WARNING ; (40) ERROR ; (50) CRITICAL / FATAL }
View loglevels.py
#!/usr/bin/env python
from __future__ import print_function
import logging
###
def addLevelName__TRACE():
logging.addLevelName(8, 'TRACE')
###
@westurner
westurner / ordereddefaultdict.py
Created Feb 12, 2016
OrderedDefaultDict_.py
View ordereddefaultdict.py
#!/usr/bin/env python
"""
ordereddefaultdict.OrderedDefaultDict
.. code:: bash
$ python ./ordereddefaultdict.py -t
$ nosetests ./ordereddefaultdict.py
$ py.test ./ordereddefaultdict.py
View rdfx_lightweightmarkuplanguages.n3
# :*_markdown_github[__html]
# :*_markdown_commonmark[__html]
# Markdown[HTML] > MarkdownGithub[HTML]
# Markdown[HTML] > MarkdownCommonmark[HTML]
rdfx:Markdown a rdfs:Datatype ;
.
rdfx:MarkdownGithub a rdfs:Datatype ;
You can’t perform that action at this time.