Skip to content

Instantly share code, notes, and snippets.

@westurner
westurner / savings_interest_and_future_value.ipynb
Last active Apr 19, 2020
savings_interest_and_future_value.ipynb
View savings_interest_and_future_value.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View jupyter_for_education.md

From "Options for giving math talks and lectures online" https://news.ycombinator.com/item?id=22539537 :

One option: screencast development of a Jupyter notebook.

Jupyter Notebook supports LaTeX (MathTeX) and inline charts. You can create graded notebooks with nbgrader and/or with CoCalc (which records all (optionally multi-user) input such that you can replay it with a time slider).

Jupyter notebooks can be saved to HTML slides with reveal.js, but if you want to execute code cells within a slide, you'll need to install RISE: https://rise.readthedocs.io/en/stable/

Here are the docs for CoCalc Course Management; Handouts, Assignments, nbgrader: https://doc.cocalc.com/teaching-course-management.html

@westurner
westurner / build_sphinx_docs_with_readthedocs_container.Dockerfile
Last active Sep 22, 2021
Build Sphinx docs locally with the ReadTheDocs Docker container
View build_sphinx_docs_with_readthedocs_container.Dockerfile
FROM readthedocs/build:latest
## Install system packages
#RUN pip install -U pip
## Install latest pip
#RUN curl -SL https://bootstrap.pypa.io/get-pip.py > get-pip.py
#RUN python ./get-pip.py
## Install dotfiles
ARG uid=1000
ARG user="app"
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.
"""