Skip to content

Instantly share code, notes, and snippets.

@d8ahazard
d8ahazard / plex_cleanup.py
Last active Jul 7, 2021
A utility for cleaning Plex collections and identifying orphaned media.
View plex_cleanup.py
import os
import pathlib
import sqlite3
target_path = ""
movie_list = []
tv_list = []
collection_list = []
@d8ahazard
d8ahazard / SectorCreator.cs
Created Aug 27, 2019
A quickie script to take all items in a SECTR terrain chunk and add them as children of that chunk.
View SectorCreator.cs
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
[ExecuteInEditMode]
public class SectorCreator : MonoBehaviour
{
@d8ahazard
d8ahazard / index.php
Last active Dec 26, 2018
PlexProfileScraper
View index.php
<?php
$files = glob("./profiles/*.xml");
$profiles = [];
$types = [];
$names = [];
foreach($files as $file) {
$data = new SimpleXMLElement(file_get_contents($file));
$flat = json_decode(json_encode($data), true);
$name = $flat['@attributes']['name'];
$dpTypes = [];
@d8ahazard
d8ahazard / swagger2Php.php
Last active Oct 11, 2018
Auto-generate PHP class from swagger documentation...
View swagger2Php.php
<?php
// You need to have guzzleHttp installed, and require the vendor path here...
header('content-type:text/plain');
$url = $_GET['url'];
$swaggerApi = json_decode(file_get_contents("$url"), true);
$outFile = pathinfo($url)['filename'] . ".php";
$paths = $swaggerApi['paths'];
$defs = $swaggerApi['definitions'];