Skip to content

Instantly share code, notes, and snippets.

View imajes's full-sized avatar

James Cox imajes

View GitHub Profile

The Speed of Light is Not Negotiable: A Plex Latency Analysis

TL;DR: Hosting Plex's API servers in eu-west-1 (Ireland) adds ~200ms of latency for US users because light only travels so fast, and this absolutely matters for interactive applications. Here's the data to prove it.

What Are We Even Looking At?

Let's start with the basics. This analysis is based on a HAR file (HTTP Archive format) — essentially a detailed recording of every single network request your browser makes when loading a page. Think of it as a black box recorder for web traffic. When you open your browser's developer tools and load a page, you can export a HAR file that captures:

  • Every URL requested
  • How long each phase of each request took (DNS lookup, TCP connection, SSL handshake, server processing, data transfer)
@imajes
imajes / miseoutput.txt
Created August 4, 2025 22:03
mise output
❯ cd Projects/railsdemo
DEBUG Version: 2025.8.4 macos-arm64 (2025-08-03)
DEBUG ARGS: /Users/james/.local/bin/mise hook-env -s zsh
DEBUG config: ~/Projects/railsdemo/mise.toml
DEBUG config: ~/.config/mise/config.toml
DEBUG Version: 2025.8.4 macos-arm64 (2025-08-03)
DEBUG ARGS: /Users/james/.local/bin/mise hook-env -s zsh
DEBUG config: ~/Projects/railsdemo/mise.toml
DEBUG config: ~/.config/mise/config.toml
@imajes
imajes / process_entries.py
Created July 29, 2025 20:46
apple-aerial-asset-parser
#!/usr/bin/env python3
"""
process_entries.py
Usage:
python process_entries.py entries.json > final_output.json
Outputs a JSON object with:
- assets: { CategoryName: { SubcategoryName: [ …assets… ] } }
- taxonomy: [ { id, name, representative_asset_id, preview_image, subcategories: [ … ] } ]
@imajes
imajes / custom_colors.lua
Created April 9, 2025 20:45
wezterm color customizatino
-- functions and behaviors to control color settings
local wezterm = require("wezterm")
-- wezterm.gui is not available to the mux server, so take care to
-- do something reasonable when this config is evaluated by the mux
local function get_appearance()
if wezterm.gui then
return wezterm.gui.get_appearance()
end
%s=0x%llx
KMGTBb
"%@" doesn't exist in entry "%@"
"%@" is not a valid data criterion
"%@" of entry "%@" is class %@ while expecting BOOL<NSNumber>
"%@" of entry "%@" is class %@ while expecting NSData
"%@" of entry "%@" is class %@ while expecting NSNumber
"%@" query failed in internal service!
"%@" query failed!
"%@" query is not successfully from internal service
-- new table bloat query
-- still needs work; is often off by +/- 20%
WITH constants AS (
-- define some constants for sizes of things
-- for reference down the query and easy maintenance
SELECT current_setting('block_size')::numeric AS bs, 23 AS hdr, 8 AS ma
),
no_stats AS (
-- screen out table who have attributes
-- which dont have stats, such as JSON
## requires the 'terminal-table' gem
RSpec.configure do |config|
config.include FactoryBot::Syntax::Methods
config.before(:suite) do
# prep factory_run tracking
FactoryBot::Analytics.track_factories
end
version: '3'
networks:
int-service-proxy:
external: true
services:
watchtower:
container_name: watchtower
restart: unless-stopped
using UnityEngine;
using System.Collections;
using System.Web;
public class GoogleMap : MonoBehaviour
{
IEnumerator _Refresh ()
{
var url = "http://maps.googleapis.com/maps/api/staticmap";