Skip to content

Instantly share code, notes, and snippets.

View deeplook's full-sized avatar

deeplook

View GitHub Profile
@deeplook
deeplook / list_repo_issues.py
Created August 30, 2011 18:59
List number of issues for project repositories on BitBucket or GitHub.
#!/usr/bin/env python
"""List number of issues for project repositories on BitBucket or GitHub.
This will list the number of issues for public repositories of a given
member with a URL like https://github.com/okfn or https://github.com/okfn.
It was written with the idea of getting insight quickly into the "issue
activity" of all projects of a repository owner.
This script uses a really simple HTML scraping approach. For anything
@deeplook
deeplook / mbox_subject_stats.py
Created October 21, 2011 13:27
Print certain stats for subject line length in mailbox files.
#!/usr/bin/env python
# _*_ coding: UTF-8 _*_
"""Print certain stats for subject line length in mailbox files.
The idea is to find out the percentage of lines up to the length
of twice the mailing list tag inside square brackets.
"""
import re
@deeplook
deeplook / test_pil_font_rendering.py
Created August 3, 2012 15:22
A script for comparing TrueType font rendering on different platforms.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A script for comparing TrueType font rendering on different platforms.
"""
import os
import sys
import platform
import argparse
@deeplook
deeplook / ipython_object_graphs.py
Last active December 12, 2015 06:39
An experimental extension for an IPython magic command to show object graphs.
"""
An experimental extension for an IPython magic command to show object graphs.
Strongly based on tkf's code for the extension itself
and mine for turning a Python namespace into a GraphViz DOT source:
- https://github.com/tkf/ipython-hierarchymagic
- http://pypi.python.org/pypi/pyrels/0.1.1
Read respective copyrights there!
@deeplook
deeplook / ipython_object_graphs.ipynb
Created February 12, 2013 14:42
An IPython notebook illustrating an IPython extension for displaying object graphs.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deeplook
deeplook / pi_digits.py
Created February 13, 2013 20:16
Generate digits of Pi using a spigot algorithm.
"""
Run the algorithm below using CPython, Cython, PyPy and Numba and compare
their performance. (This is implementing a spigot algorithm by A. Sale,
D. Saada, S. Rabinowitz, mentioned on
http://mail.python.org/pipermail/edu-sig/2012-December/010721.html).
"""
def pi_digits(n):
"Generate n digits of Pi."
k, a, b, a1, b1 = 2, 4, 1, 12, 4
@deeplook
deeplook / image_displayhook.ipynb
Created March 14, 2013 15:41
An IPython notebook playing with display hook functions to display PIL images and Reportlab drawings.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deeplook
deeplook / speedread.py
Last active June 5, 2022 20:32
An experiment in speed reading texts in a terminal.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
An experiment in speed reading texts in a terminal.
It implements a "poor man's" version running in a plain terminal. The speed
is given in wpm, words per second. KeyboardInterrupts are captured for pausing
the presentation. At the end a summary is printed. This toy project is much
inspired by an iOS app named ReadQuick:
@deeplook
deeplook / gist:4e68d09b84c3ca1ffe14
Last active August 29, 2015 14:18
Top 100 of most downloaded packages on PyPI as of 2015-04-10.
+-----+-----------------+-----------------+
| # | Package Name | Total Downloads |
+-----+-----------------+-----------------+
| 1 | setuptools | 52,454,151 |
| 2 | requests | 42,297,369 |
| 3 | virtualenv | 38,499,034 |
| 4 | distribute | 36,848,278 |
| 5 | six | 34,594,923 |
| 6 | boto | 33,578,502 |
| 7 | pip | 29,951,145 |
@deeplook
deeplook / nix-vs-python.rst
Created February 21, 2016 14:10
Taking the "Nix tour" with a Python background.

Nix vs. Python

An attempt at contrasting Nix and Python syntax (maybe helpful to grasp Nix faster for those with a Python background) based on the "Nix tour" found here: https://nixcloud.io/tour/?id=1

1. A tour of Nix