Skip to content

Instantly share code, notes, and snippets.

Jonathan LaCour cleverdevil

Block or report user

Report or block cleverdevil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cleverdevil
cleverdevil / rings.php
Created Feb 13, 2019
Quick and dirty activity rings clone in SVG
View rings.php
<!-- 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 Jan 15, 2019
Fetch recently played episodes from Overcast.fm. Then, publish history to my website.
View overcast-recently-played.py
'''
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 Jan 6, 2019
Quick script to publish my Trakt history to my website
View traktpub.py
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 Mar 5, 2018
Upload my directory full of instagram photos to my website, using granary to look up the metadata
View upload-insta.py
#!/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 Mar 5, 2018
Process fb-export album data, upload the photos to a Micropub media endpoint, and export MF2-JSON data for posts
View process_albums.py
#!/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 Mar 6, 2018
Import MF2 JSON selectively
View publish.py
#!/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 Mar 6, 2018
Transform Facebook JSON exports to MF2 JSON
View transform.py
#!/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 Dec 14, 2017
Current hammerspoon configuration
View init.lua
-- -----------------
-- 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()
@cleverdevil
cleverdevil / html5-video.sh
Created Aug 21, 2017
Convert an arbitrary video to HTML5 compatible formats and output the HTML needed to embed the video
View html5-video.sh
#!/bin/sh
ffmpeg -i $1 -b:v 1500k -vcodec libx264 -g 30 html5-$1.mp4 &>/dev/null
ffmpeg -i $1 -b:v 1500k -vcodec libvpx -acodec libvorbis -ab 160000 -f webm -g 30 html5-$1.webm &>/dev/null
ffmpeg -i $1 -b:v 1500k -vcodec libtheora -acodec libvorbis -ab 160000 -g 30 html5-$1.ogv &>/dev/null
echo "<video controls>"
echo " <source src=\"html5-$1.mp4\" type=\"video/mp4\">"
echo " <source src=\"html5-$1.webm\" type=\"video/webm\">"
echo " <source src=\"html5-$1.ogg\" type=\"video/ogg\">"
@cleverdevil
cleverdevil / main.py
Last active Aug 4, 2017
Scripts for updating 🐷🔥.ws
View main.py
import stoker
import micropub
import time
MICROPUB_ENDPOINT = 'https://xn--cp8h2o.ws/micropub/endpoint'
INDIEAUTH_TOKEN = 'REDACTED'
SYNDICATE_TO = 'twitter::JonsHotMeat'
s = stoker.Stoker('bbq.lacour.local', timeout=120)
You can’t perform that action at this time.