Skip to content

Instantly share code, notes, and snippets.

@nickv2002
nickv2002 / undupe-transode.py
Created Jan 19, 2020
Transcode Found Video Files to HEVC (H.265) and optimally remove the older versions
View undupe-transode.py
#!/usr/bin/env python3
import os
import sys
import glob
import subprocess
import shlex
import shutil
import pathlib
import itertools
View cards.json.converter.py
#!/usr/bin/env python
# coding=utf-8
import json, os, sys, io, re
from pprint import pprint
with io.open('/Users/nick/Documents/dominiontabs/card_db/en_us/cards.json') as data_file:
cardDict = json.load(data_file)
with io.open('/Users/nick/Documents/dominiontabs/card_db/en_us/card_groups.json') as data_file:
groupDict = json.load(data_file)
@nickv2002
nickv2002 / YouTubePlayerViaTVJS.swift
Last active Oct 21, 2021
Swift code to play YouTube videos on AppleTV tvOS via a TVJS call using XCDYouTubeKit
View YouTubePlayerViaTVJS.swift
//
// Created by Nick Vance on 12/4/15.
// Copyright © 2015 ToWatchList. All rights reserved.
//
import AVKit
import XCDYouTubeKit
import TVMLKit
class YTPlayerViewController: AVPlayerViewController, AVPlayerViewControllerDelegate {
@nickv2002
nickv2002 / mean_median_filters.py
Last active Jul 28, 2021 — forked from bhawkins/medfilt.py
1-Dimentional Mean and Median Filters
View mean_median_filters.py
#!/usr/bin/env python
def medfilt (x, k):
"""Apply a length-k median filter to a 1D array x.
Boundaries are extended by repeating endpoints.
"""
import numpy as np
assert k % 2 == 1, "Median filter length must be odd."
assert x.ndim == 1, "Input must be one-dimensional."