Skip to content

Instantly share code, notes, and snippets.

View jamtur01's full-sized avatar
💭
I may be slow to respond.

James Turnbull jamtur01

💭
I may be slow to respond.
View GitHub Profile
(ns monster.distance)
(defn min-monster-distance
"Given a collection of monster positions `positions` (numbers) and a minimum
safe separation `d`, return
* the smallest distance between any two monsters **if** that distance
is less than `d`
* -1 if every pair of monsters is at least `d` units apart.
Stream API
The API endpoints for streams and metadata.
Stream Search
Search for a list of stream links.
Note that in addition to the number of retrieved streams deducted from the user's daily link limit, the debridlookup, filematch, and sort=best options might subtract additional points from the limit. Each of these parameters has a weighted contribution to the daily link limit, depending on the complexity of the task. Hence, if 100 links are retrieved, more than 100 points might be deducted from the limit if these features are utilized. If you decide to incorporate these options, consider allowing users to disable them in your app settings.
Requests are subject to the user's daily link limit.
Parameters
Name Required Type Options Example Description
(defn remove-sirens [sirens]
(let [sorted (sort-by :end sirens)]
(loop [remaining sorted
last-end Integer/MIN_VALUE
keep-count 0]
(if (empty? remaining)
(- (count sirens) keep-count)
(let [{:keys [start end]} (first remaining)]
(if (>= start last-end)
(recur (rest remaining) end (inc keep-count))
(defn meal-prep
"Calculate minimum hours needed to cook meals given prep times in minutes.
Each meal must be cooked for its full duration (rounded up to nearest hour).
Up to 2 meals can be cooked simultaneously.
Args:
prep-times - Collection of meal preparation times in minutes
Returns:
Minimum hours needed to cook all meals"
@jamtur01
jamtur01 / auto-buttons.js
Last active April 2, 2025 02:09
Auto-press Skip Buttons on Plex
// ==UserScript==
// @name Trigger on Skip Forward Button Click by Adjusting Video Time
// @version 1.2
// @description Adjust video time when the Skip Forward button is clicked in the Plex player, even across episodes or media changes.
// @author James Turnbull
// @match *://*/*
// @grant none
// @license MIT
// ==/UserScript==
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: Amethyst [43442]
Path: /Applications/Amethyst.app/Contents/MacOS/Amethyst
Identifier: com.amethyst.Amethyst
Version: 0.21.1 (111)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
<nut>
<filename>Nut.js</filename>
<endpoints>
<endpoint>/api/nut/diagnostics/upsstatus</endpoint>
</endpoints>
<translations>
<title>Nut UPS Server</title>
<help>Nut Server UPS status.</help>
<unconfigured>Nut not available or not configured.</unconfigured>
</translations>
{"tabs":["overview","table","matches","stats"],"allAvailableSeasons":["2023/2024","2022/2023","2021/2022","2020/2021","2019/2020","2018/2019"],"details":{"id":9907,"type":"league","name":"Liga F","selectedSeason":"2023/2024","latestSeason":"2023/2024","shortName":"Liga F","country":"ESP","faqJSONLD":null,"breadcrumbJSONLD":{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.fotmob.com"},{"@type":"ListItem","position":2,"name":"Liga F","item":"https://www.fotmob.com/leagues/9907/overview/liga-f"}]}},"seostr":"liga-f","QAData":[],"table":[{"data":{"ccode":"ESP","leagueId":9907,"pageUrl":"/leagues/9907/overview/liga-f","leagueName":"Liga F","legend":[{"title":"Champions League","tKey":"championsleague","color":"#2AD572","indices":[0]},{"title":"Champions League qualification","tKey":"clqual","color":"#FFD908","indices":[1,2]},{"title":"Relegation","tKey":"relegation","color":"#FF4646","indices":[14,15]}],"ongoing":[{"id":
{"tabs":["overview","table","matches","stats"],"allAvailableSeasons":["2023/2024","2022/2023","2021/2022","2020/2021","2019/2020","2018/2019"],"details":{"id":9907,"type":"league","name":"Liga F","selectedSeason":"2023/2024","latestSeason":"2023/2024","shortName":"Liga F","country":"ESP","faqJSONLD":null,"breadcrumbJSONLD":{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.fotmob.com"},{"@type":"ListItem","position":2,"name":"Liga F","item":"https://www.fotmob.com/leagues/9907/overview/liga-f"}]}},"seostr":"liga-f","QAData":[],"table":[{"data":{"ccode":"ESP","leagueId":9907,"pageUrl":"/leagues/9907/overview/liga-f","leagueName":"Liga F","legend":[{"title":"Champions League","tKey":"championsleague","color":"#2AD572","indices":[0]},{"title":"Champions League qualification","tKey":"clqual","color":"#FFD908","indices":[1,2]},{"title":"Relegation","tKey":"relegation","color":"#FF4646","indices":[14,15]}],"ongoing":[],"tab

openpgp4fpr:A2C861F07924C92D698D5DDA6AFC66C2625EC8BB