Skip to content

Instantly share code, notes, and snippets.

View cleverdevil's full-sized avatar

Jonathan LaCour cleverdevil

View GitHub Profile
@cleverdevil
cleverdevil / dovi_tagger.py
Last active October 30, 2024 00:41
Dolby Vision Tagger for Plex
'''
Dolby Vision Tagger for Plex
============================
This script walks your Plex server's libraries and tags Dolby Vision Profile
and Enhancement Layer details by attaching a label. The label will be of
format:
Dolby Vision P{profile number} {enhancement layer}
@cleverdevil
cleverdevil / dovi_report.py
Last active September 11, 2024 21:23
Dolby Vision report script. Walks a directory tree of video files and reports on Dolby Vision profiles and enhancement layers.
import os
import pathlib
import subprocess
import json
root = '/volume1/Media/Movies'
dovi_metadata = {'videos': [], 'total': 0, 'total_dovi': 0, 'total_p7_fel': 0}
@cleverdevil
cleverdevil / rings.php
Created February 13, 2019 18:49
Quick and dirty activity rings clone in SVG
<!-- thanks to https://codepen.io/webslingerm/pen/GXxxVx -->
<?php
$move = $_GET["move"] ? $_GET["move"] : 0;
$exercise = $_GET["exercise"] ? $_GET["exercise"] : 0;
$stand = $_GET["stand"] ? $_GET["stand"] : 0;
?>
<style type="text/css">
@-webkit-keyframes RingProgress {
@cleverdevil
cleverdevil / overcast-recently-played.py
Last active March 4, 2024 09:28
Fetch recently played episodes from Overcast.fm. Then, publish history to my website.
'''
You'll need to pip install some dependencies:
* python-dateutil
* requests
Also, populate your EMAIL and PASSWORD below.
'''
from xml.etree import ElementTree
@cleverdevil
cleverdevil / traktpub.py
Created January 6, 2019 01:20
Quick script to publish my Trakt history to my website
from dateutil.tz import UTC
from dateutil.parser import parse
from datetime import datetime
import conf
import json
import os
import feedparser
import requests
@cleverdevil
cleverdevil / upload-insta.py
Created March 5, 2018 01:38
Upload my directory full of instagram photos to my website, using granary to look up the metadata
#!/usr/bin/env python
import os
import sys
import requests
base_url = 'https://granary.io/instagram/cleverdevil/@self/@app/%s'
query_args = {
'format': 'mf2-json',
@cleverdevil
cleverdevil / process_albums.py
Created March 5, 2018 01:20
Process fb-export album data, upload the photos to a Micropub media endpoint, and export MF2-JSON data for posts
#!/usr/bin/env python
'''
Conditionally upload all of the photos from an exported Facebook album to a
Micropub-compatible website with a media endpoint, and dump MF2-JSON data
that can later be published to the same Micropub website.
'''
import json
import sys
@cleverdevil
cleverdevil / publish.py
Last active March 6, 2018 00:54
Import MF2 JSON selectively
#!/usr/bin/env python
'''
A script for quickly publishing MF2 content to a Micropub endpoint. To use this
script, first ensure that you have installed:
requests
You will also need to set the following environment variables:
@cleverdevil
cleverdevil / transform.py
Last active March 6, 2018 00:54
Transform Facebook JSON exports to MF2 JSON
#!/usr/bin/env python
'''
Usage:
./transform <path-to-facebook-export.json>
This will transform everything using granary and then place
individual files into a directory called "mf2."
@cleverdevil
cleverdevil / init.lua
Created December 14, 2017 18:05
Current hammerspoon configuration
-- -----------------
-- Setup environment
-- -----------------
-- Animation off, mofo
hs.window.animationDuration = 0
-- Get list of screens and refresh that list whenever screens are (un)plugged
local screens = hs.screen.allScreens()
local screenwatcher = hs.screen.watcher.new(function()