Skip to content

Instantly share code, notes, and snippets.

View devcutler's full-sized avatar

Richard Cutler devcutler

  • Canada
  • 17:19 (UTC -04:00)
View GitHub Profile
@devcutler
devcutler / README.md
Created December 17, 2022 15:46
My *arr stack with Jellyfin running on Docker.

docker-compose.yml configuration

  1. Mullvad needs a key and address space from one of the files you get from here. Input those into their respective fields in gluetun's environment variables. If you're not using Mullvad, follow any of the Provider guides on gluetun's wiki.
  2. Change any volume paths you want to be different. In the current setup the stack creates a directory per service for that service's configurations and then a single media directory for media storage.
  3. Set your PGID and PUID environment variables in any services that use them. This is used to ensure services can access the files they use.

Service configuration

Following respective services' setup guides will work for most cases, but these are some things to remember.

@devcutler
devcutler / slope.js
Last active April 7, 2022 15:45
Some functions for doing slope calculations that I wrote during my math class
// uses https://github.com/ekg/fraction.js for displaying equation in fraction form
var Fraction = require('fractional').Fraction;
// returns the slope of a line in either a float or a string representation of a fraction, for reading.
// pass in two xy coordinate points and a boolean.
// if the boolean is true, it will return the fraction representation, and if false, a float.
// the xy coordinate points should be either arrays [x, y] or objects {x: 1, y: 1}
function slope(p1, p2, frac) {
return frac ?
new Fraction(((p2.y || p2[1]) - (p1.y || p1[1])), ((p2.x || p2[0]) - (p1.x || p1[0]))).toString()
@devcutler
devcutler / create.js
Last active January 24, 2022 01:06
A basic function to create a simple HTML element in a one-liner.
/**
* @author [arynthernium](https://github.com/arynthernium)
* @param {string} tag Can be any valid HTML tag.
* @param {string} innerHTML String to set as the innerHTML of the returned node.
* @param {object} attrs An object of attributes to be applied with setAttribute.
* @param {object} styles Object with valid JS style keys for CSS styles.
* @returns {HTMLElement}
*/
function create(tag = 'div', innerHTML = '', attrs, styles) {
const node = document.createElement(tag);
@devcutler
devcutler / folderstream.sh
Last active April 15, 2021 22:20
Stream entire folders of episodes to an RTMP server. Examples are for Brime Live, but you can use any RTMP service. (file format is mkv, but you can change that to anything ffmpeg can handle.)
#!/bin/bash
echo Folder to queue?
read folder
num=$(ls $folder | wc -l)
echo Queued $num episodes. Double-tap \^C to stop.
sleep 2
until [ $epnum -gt $num ]
do