Skip to content

Instantly share code, notes, and snippets.

@jefftriplett
jefftriplett / .dockerignore
Last active November 20, 2022 21:44
How I use Docker and Compose
.*
!.coveragerc
!.env
!.pylintrc
@jefftriplett
jefftriplett / Makefile
Last active April 3, 2017 18:02
Toggl Desktop Makefile for nativefier + sips + iconutil
build: build_toggl_icon build_toggl
.PHONY: build_toggl
build_toggl:
@mkdir -p build/Toggl.iconset
@nativefier \
--overwrite \
--name Toggl \
--icon build/Toggl.icns \
@jefftriplett
jefftriplett / fetch_dcus.py
Last active December 6, 2016 21:01
This script fetches blog articles off of the DCUS website and converts them to markdown.
import click
import codecs
import dateparser
import frontmatter
import os
import requests
import requests_cache
from bs4 import BeautifulSoup
from unidecode import unidecode
@jefftriplett
jefftriplett / spotify_playlist_export.py
Last active October 24, 2020 02:49
Dump your Spotify playlists to YAML or Markdown using Python.
"""
Formatting based on:
https://en.wikipedia.org/wiki/Wikipedia:WikiProject_Albums/Album_article_style_guide
YAML formatting inspired by:
https://github.com/katydecorah/katydecorah.github.io/blob/master/_data/playlists.yml
Method inspired from:
- https://github.com/plamere/spotipy/blob/master/examples/user_playlists_contents.py
- https://github.com/jacobian/rdio-takeout-importer/blob/master/r2s.py#L68
1204c1204
<
---
>
1338c1338
< warnings.warn(b"".join(errors), RuntimeWarning)
---
> warnings.warn(b"".join(errors).decode(), RuntimeWarning)

2016 NCAA Men's Basketball

South

Team Round 64 Round 32 Round 16 Round 8 Final 4 Final
Kansas (1) 0.9898 0.9252 0.7875 0.5807 0.3594 0.2049
Austin Peay (16) 0.0102 0.0013 0.0001 0.0000 0.0000 0.0000
Colorado (8) 0.6174 0.0513 0.0172 0.0037 0.0005 0.0001
Connecticut (9) 0.3826 0.0223 0.0057 0.0008 0.0001 0.0000
"""
Formatting based on:
https://en.wikipedia.org/wiki/Wikipedia:WikiProject_Albums/Album_article_style_guide
Method inspired from:
- https://github.com/plamere/spotipy/blob/master/examples/user_playlists_contents.py
- https://github.com/jacobian/rdio-takeout-importer/blob/master/r2s.py#L68
Getting started:
import click
import json
from livescrape import ScrapedPage, Css, CssLink, CssMulti
class TeamRosterPage(ScrapedPage):
scrape_url = 'http://stats.ncaa.org/team/roster/%(season_id)s?org_id=%(team_id)s'
scrape_args = ('season_id', 'team_id')
table_contents = CssMulti(
"""
Quick attempt to extract speakers and talks from every DjangoCon US.
To install requirements:
pip install click grab unicodecsv
Goals: