Skip to content

Instantly share code, notes, and snippets.

@kernc
kernc / yt_playlist_import.py
Last active Sep 22, 2019
Import local M3U file list as YouTube playlist
View yt_playlist_import.py
"""
Import local M3U playlists into YouTube as playlist.
The script accepts one argument, path to an M3U playlist, such as one produces with:
find mp3/genre/directory -type f > My_genre_name_playlist_name.m3u
It then searches for the best video match to each item in the playlist
and adds it to a newly created PRIVATE YouTube playlist bearing the
M3U playlist file name.
@kernc
kernc / skytorrents.py
Created Jun 11, 2018
SkyTorrents.lol search plugin for qBittorrent
View skytorrents.py
# -*- coding: utf-8 -*-
#VERSION: 2.0
#AUTHORS: Joost Bremmer (toost.b@gmail.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
View bokeh interactive autoscaling candlestick.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kernc
kernc / audiobook-volume-amplifier.sh
Last active Apr 30, 2016
Increase the volume -- and impair the quality -- of your audiobooks
View audiobook-volume-amplifier.sh
#!/bin/bash
set -e
if [ $# != 0 ]; then
echo "Usage: $(basename "$0")
This program accepts no arguments. It takes all the *.mp3 files
in the current directory and makes them louder by first detecting
their mean and max volumes and then amplifying the mean volume by
@kernc
kernc / test_doctests.py
Last active Feb 6, 2016
unittest.TestSuite module that recursively loads all doctests from my package
View test_doctests.py
"""
unittest.TestSuite module that recursively loads all doctests from my package
"""
from doctest import DocTestSuite, ELLIPSIS, NORMALIZE_WHITESPACE
SKIP_DIRS = (
'MyPackage/unimportable-modules/',
'MyPackage/skip_this_too',
@kernc
kernc / gtk_menu_hierarchy.py
Created Sep 1, 2014
Constructing multi-level GtkMenu by example of time zone hierarchy.
View gtk_menu_hierarchy.py
""" Constructing multi-level GtkMenu by example of time zone hierarchy.
The example below is missing a GtkWindow and a gtk.main() to work."""
import gtk
from collections import defaultdict
from commands import getoutput
def autovivified():
return defaultdict(autovivified)
@kernc
kernc / null.py
Last active Jan 2, 2020
Null object pattern (Python)
View null.py
"""
This module provides the Null class for the null object design pattern.
"""
from collections import MutableMapping, MutableSequence
class _MetaNull(type): pass
class Null(type):
"""Null object design pattern.
You can’t perform that action at this time.