Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
Staying home

Chris Adams acdha

🏡
Staying home
View GitHub Profile
@acdha
acdha / overcast.opml
Last active Mar 22, 2019
Current podcast subscriptions
View overcast.opml
<?xml version="1.0"?>
<opml version="1.0">
<head>
<title>Overcast Podcast Subscriptions</title>
</head>
<body>
<outline type="rss" text="Death, Sex &amp; Money" title="Death, Sex &amp; Money" xmlUrl="http://feeds.feedburner.com/deathsexmoney" htmlUrl="http://www.wnycstudios.org/shows/deathsexmoney"/>
<outline type="rss" text="Reveal" title="Reveal" xmlUrl="http://feeds.revealradio.org/revealpodcast" htmlUrl="http://www.revealnews.org/"/>
<outline type="rss" text="This American Life" title="This American Life" xmlUrl="http://feed.thisamericanlife.org/talpodcast" htmlUrl="https://www.thisamericanlife.org/"/>
<outline type="rss" text="Working" title="Working" xmlUrl="http://feeds.feedburner.com/SlatesWorking" htmlUrl="http://www.slate.com/podcasts"/>
@acdha
acdha / download_url.py
Created Jan 19, 2018
Example of a chunked downloader using Requests
View download_url.py
#!/usr/bin/env python
# encoding: utf-8
"""Download one or more URLs with a running progress display"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import sys
from timeit import default_timer
View threadpool-error-handling-comparison.py
#!/usr/bin/env python
from __future__ import absolute_import, print_function
from multiprocessing.pool import ThreadPool
from random import random
from time import sleep
from timeit import default_timer
import sys
View list-whitespace.py
#!/usr/bin/env python3
from unicodedata import category, name
from sys import maxunicode
for i in range(0, maxunicode):
char = chr(i)
if category(char) == 'Zs':
print(i, name(char), char, sep='\t')
View .stylelintrc
{
"plugins": [
"stylelint-order"
],
"extends": "stylelint-config-standard",
"rules": {
"indentation": 4,
"function-comma-newline-after": "always-multi-line",
"function-comma-space-after": "always",
"function-parentheses-newline-inside": "always-multi-line",
@acdha
acdha / locals.py
Created Feb 15, 2017
How to see the modules available in your current local namespace
View locals.py
import inspect
import math
print("all local variables:")
print(locals())
print()
print("just the modules:")
print([name for name, value in locals().items() if inspect.ismodule(value)])
@acdha
acdha / .gitattributes
Last active Jan 23, 2017
Example using Git attributes to make human-friendly output from custom file formats
View .gitattributes
bagit.xml diff=xml2rfc
@acdha
acdha / .stylelintrc.json
Created Dec 19, 2016
Generate stylelint-order declaration-block-property-groups-structure lists from csscomb presets
View .stylelintrc.json
{
"plugins": [
"stylelint-order"
],
"extends": "stylelint-config-standard",
"rules": {
"order/declaration-block-property-groups-structure": [
[
{
"emptyLineBefore": "always",
@acdha
acdha / Results using Python 2.7.12
Last active Nov 8, 2016
Python sparse list memory / time benchmarks
View Results using Python 2.7.12
Testing size 100
⏱ allocate empty list 0.00001 seconds
Empty list size: 888
⏱ populate list with fake results 0.00003 seconds
“Populated” list size: 5848
⏱ allocate empty sparse list 0.00000 seconds
Empty list size: 808
⏱ populate sparse list with fake results 0.00003 seconds
“Populated” list size: 6776
@acdha
acdha / homebrew-gdal-ctypes.traceback
Created Oct 3, 2016
Traceback from a crash introduced by a recent Homebrew update when Python ctypes tries to load gdal
View homebrew-gdal-ctypes.traceback
Traceback (most recent call last):
File "/Users/cadams/.virtualenvs/wdl/bin/django-admin", line 11, in <module>
sys.exit(execute_from_command_line())
File "/Users/cadams/.virtualenvs/wdl/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
utility.execute()
File "/Users/cadams/.virtualenvs/wdl/lib/python2.7/site-packages/django/core/management/__init__.py", line 328, in execute
django.setup()
File "/Users/cadams/.virtualenvs/wdl/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/cadams/.virtualenvs/wdl/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
You can’t perform that action at this time.