This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name VLC playback link for Emby web client | |
// @namespace LeMinaw/EmbyVLCPlayback | |
// @version 1.0.0 | |
// @description Add a "Copy VLC command" link to Emby media pages. | |
// @author LeMinaw | |
// @grant none | |
// @match *://emby.*.synology.me/* | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db.models import F, QuerySet | |
from django.db.models.functions import Coalesce | |
from modeltranslation.settings import AVAILABLE_LANGUAGES | |
from modeltranslation.utils import ( | |
build_localized_fieldname, get_language, resolution_order) | |
class MultilingualOrderQuerySet(QuerySet): | |
def coalesce_translations(self, field): | |
"""Coalesce all translations of a given field according to the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg> | |
<filter id="only-red"> | |
<!-- Build an alpha mask to match pixels where R>G and R>B --> | |
<!-- That "192" value can be adjusted to change the selectivity of the selection --> | |
<feColorMatrix result="mask" values=" | |
0 0 0 0 0 | |
0 0 0 0 0 | |
0 0 0 0 0 | |
192 -255 -255 0 1 | |
"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
MaterializeCSS tweak to allow text filtering in multiple selects. | |
It should be fairly easy to adapt it for use in single selects. :-) | |
*/ | |
document.addEventListener('DOMContentLoaded', event => { | |
document.querySelectorAll('select[searchable]').forEach(elem => { | |
const select = elem.M_FormSelect; | |
const options = select.dropdownOptions.querySelectorAll('li:not(.optgroup)'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
vdot = lambda x, y: np.float64(x.T * y) | |
norm2 = lambda x: vdot(x, x) | |
norm = lambda x: np.sqrt(norm2(x)) | |