Skip to content

Instantly share code, notes, and snippets.

@RomkeVdMeulen
RomkeVdMeulen / key-listener.ts
Last active December 27, 2021 05:59
TypeScript decorator to apply to a method that should only be invoked in response to certain keypress events.
export const enum KeyCode {
ENTER = 13,
SPACE = 32
}
export function keyListener(keyCodes: KeyCode | KeyCode[]) {
if (!(keyCodes instanceof Array)) {
keyCodes = [keyCodes];
}
@pylover
pylover / a2dp.py
Last active May 27, 2024 21:51
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware