Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Butcher nickbutcher

View GitHub Profile
View macUKKeyboardRemap.sh
#!/bin/bash
function keymapRemap() {
hidutil property --set '{"UserKeyMapping":[
{
"HIDKeyboardModifierMappingSrc":0x700000064,
"HIDKeyboardModifierMappingDst":0x700000029
}
]}'
}
@lurbas
lurbas / DuotoneColorFilter.java
Last active Jun 7, 2019
Duotone ColorFilter for Android
View DuotoneColorFilter.java
public ColorFilter duotoneColorFilter(@ColorInt int colorBlack, @ColorInt int colorWhite, float contrast) {
ColorMatrix cm = new ColorMatrix();
ColorMatrix cmBlackWhite = new ColorMatrix();
float lumR = 0.2125f;
float lumG = 0.7154f;
float lumB = 0.0721f;
float[] blackWhiteArray = new float[]{
lumR, lumG, lumB, 0, 0,
lumR, lumG, lumB, 0, 0,