Skip to content

Instantly share code, notes, and snippets.

View potgieterdl's full-sized avatar

Derick Potgieter potgieterdl

  • Dublin
  • 05:50 (UTC +01:00)
View GitHub Profile
@potgieterdl
potgieterdl / enable_aptx_aac_macos.sh
Last active September 1, 2020 14:56 — forked from zema1/enable_aptx_aac_macos.sh
Enable AAC codecs on macOS 256kbps - Sony WH-1000XM4
# (c) 2018 Marcelo Novaes
# License - MIT
# Enable AptX and AAC codecs on bluetooth connections on macOS, fixes Sony WH-1000XM4 sony quality on mac catalina
# hold in options key while clicking on the bluetooth icon, this enables debug. select your audio device and take a look at the codec used. Should be AAC (or aptx)
sudo defaults write bluetoothaudiod "Enable AAC code" -bool true
sudo defaults write bluetoothaudiod "Enable AptX codec" -bool true
# default is 128, changing to match most high quality streaming services (youtube music, high, 256kbps AAC)
# https://support.google.com/youtubemusic/answer/9076559?hl=en
@potgieterdl
potgieterdl / consist_hash.java
Created January 19, 2020 14:52 — forked from bcambel/consist_hash.java
Consistent Hash Java implementation
import java.util.Collection;
import java.util.SortedMap;
import java.util.TreeMap;
public class ConsistentHash<T> {
private final HashFunction hashFunction;
private final int numberOfReplicas;
private final SortedMap<Integer, T> circle = new TreeMap<Integer, T>();
@potgieterdl
potgieterdl / consist_hash.java
Created January 19, 2020 14:52 — forked from bcambel/consist_hash.java
Consistent Hash Java implementation
import java.util.Collection;
import java.util.SortedMap;
import java.util.TreeMap;
public class ConsistentHash<T> {
private final HashFunction hashFunction;
private final int numberOfReplicas;
private final SortedMap<Integer, T> circle = new TreeMap<Integer, T>();