Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View othyn's full-sized avatar
🏳️‍🌈
Be kind, and have an adventure.

Ben othyn

🏳️‍🌈
Be kind, and have an adventure.
View GitHub Profile
@nielsvanvelzen
nielsvanvelzen / jf-dev-auth.md
Last active April 18, 2024 14:00
Jellyfin API Authorization

Jellyfin API Authorization

To start using the Jellyfin API, authorization is probably the first thing you'll need to do. Jellyfin's authorization options can be a bit confusing because there are a lot of deprecated options.

Generally there are three ways to authenticate: no authorization, user authorization with an access token or authorization with an API key. The first way is easy, just do nothing. But most often you'll need to use either the access token or API key.

Sending authorization values

There are multiple methods for transmitting authorization values, however, some are outdated and scheduled to be removed. It's recommend to use the Authorization header. If header auth isn't an option, the token may be sent through the ApiKey query parameter. Sending secure data in a query parameter is unsafe as the changes of it leaking (via logs, copy-paste actions or by other means) are high. Only use this method as a last resort.

@othyn
othyn / App.swift
Last active January 30, 2024 10:58
How to disable default menu bar items in Swift / SwiftUI for macOS
//
// App.swift
//
// Created by Ben Tindall on 30/03/2022.
//
import Foundation
import SwiftUI
import Cocoa
@acouvreur
acouvreur / sync-unmonitored.sh
Last active October 16, 2023 21:24
Sync deleted files from Radarr/Sonarr
#!/bin/bash
# Find existing files in download/complete that are not in movies or tvshows.
export DOWNLOAD_FOLDER=path/to/downloads
export MOVIES_FOLDER=path/to/movies
export TVSHOWS_FOLDER=path/to/tvshows
findExistingFile() {
file=$(find $MOVIES_FOLDER/ $TVSHOWS_FOLDER/ -samefile "$1")
@ardzz
ardzz / phpdocs_facade_generator.php
Last active March 15, 2024 18:23
PHPDocs facades laravel generator
<?php
/**
* Class FacadePHPDocs
*
* @author Ardhana <ardzz@indoxploit.or.id>
*/
class FacadePHPDocs{
/**
* @var ReflectionClass
@qoomon
qoomon / youtube_clean_watch_later_videos.js
Last active April 15, 2024 07:25
Clean YouTube Watch Later Videos
// Version 2.0.1
// This script will remove all videos from watch later list
//
// Usage
//
// #1 go to https://www.youtube.com/playlist?list=WL
// #2 run following script in your browser console
(async function() {
const playlistName = document.querySelector('.metadata-wrapper #container #text')?.textContent || document.querySelector('#text')?.textContent
@adelynx
adelynx / generate-ssh-key.sh
Created October 15, 2020 22:19 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
import SwiftUI
import PlaygroundSupport
struct ContentView: View {
@State var gradientAngle: Double = 0
var colors = [
Color(UIColor.systemRed),
Color(UIColor.systemOrange),
Color(UIColor.systemYellow),
Color(UIColor.systemGreen),
@CodingMonkTech
CodingMonkTech / Configurations for Laravel app on Kubernetes - Dockerfile
Last active March 28, 2024 03:12
Deploying laravel on kubernetes cluster - Ready to use configuration Files
FROM php:7.2-fpm
COPY app /var/www/
EXPOSE 9000
@Amzd
Amzd / Binding+didSet.swift
Last active September 20, 2023 05:27
SwiftUI Binding wrappers for willSet and didSet
extension Binding {
/// Wrapper to listen to didSet of Binding
func didSet(_ didSet: @escaping ((newValue: Value, oldValue: Value)) -> Void) -> Binding<Value> {
return .init(get: { self.wrappedValue }, set: { newValue in
let oldValue = self.wrappedValue
self.wrappedValue = newValue
didSet((newValue, oldValue))
})
}
@sledsworth
sledsworth / NutrientModel.swift
Last active April 17, 2021 16:48
Generic Animated Progress Bar in SwiftUI
import Foundation
import UIKit
import SwiftUI
import Combine
class NutrientModel: Progressable {
var willChange = PassthroughSubject<BaseNutrient, Never>()
var id = UUID.init()
var name: String