Skip to content

Instantly share code, notes, and snippets.

@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
@aaronpk
aaronpk / media-endpoint.php
Last active March 6, 2021 23:47
an example of a Micropub Media Endpoint https://www.w3.org/TR/micropub/#media-endpoint
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Authorization');
if(isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/plain') !== false) {
$format = 'text';
} else {
header('Content-Type: application/json');
$format = 'json';
}