Skip to content

Instantly share code, notes, and snippets.

@DennyWeinberg
DennyWeinberg / settings.json
Last active September 1, 2023 09:07
A VS Code settings file that contains what's needed to work properly with python. It configures tests and linting, so all imports are recognized and all problems are detected correctly, globally. Please install the python extensions pack in VS Code first.
{
"python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test_*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
@DennyWeinberg
DennyWeinberg / strings.xml.py
Created February 14, 2023 14:10
Print the android strings.xml with it's items name, original (en) value and specific language values with a \t separator, so we can copy paste them into a sheet or create a CSV file to manual translations
from glob import glob
from os.path import join, exists, basename, dirname
from lxml import etree
# Input
res_path = r'/Users/dennyweinberg/git-clones/android-photos/app/src/main/res'
languages_to_extract = ['', 'it']
def get_translations(incl_non_translatable):
@DennyWeinberg
DennyWeinberg / keyboards.json
Last active October 2, 2023 06:25
Karabiner Elements JSON configuration for an external keyboard (And RDP specific things)
{
"title": "DWE",
"rules": [
{
"description": "Keyboards",
"manipulators": [
{
"description": "Space is switch to external keyboard input source", "type": "basic",
"from": {"key_code": "spacebar"}, "to": [{"select_input_source": {"input_source_id": "com.apple.keylayout.German-DIN-2137"}}, {"key_code": "spacebar"}],
@DennyWeinberg
DennyWeinberg / mouse.json
Last active August 31, 2023 14:34
Karabiner Elements JSON configuration for an external mouse (And RDP specific things)
{
"title": "DWE",
"rules": [
{
"description": "Mouse",
"manipulators": [
{
"description": "Mouse back (Not for RDP)", "type": "basic",
"from": {"pointing_button": "button4"}, "to": [{"key_code": "left_arrow", "modifiers": ["command"]}],
"conditions": [
@DennyWeinberg
DennyWeinberg / rdp.json
Last active April 7, 2024 03:54 — forked from toonetown/karabiner-elements-remote-desktop.json
Karabiner Elements JSON configuration for Microsoft Remote Desktop
{
"title": "DWE",
"rules": [
{
"description": "RDP",
"manipulators": [
{
"type": "basic", "description": "Completely disabled the windows key (Startmenu)",
"from": { "key_code": "left_command" },
"to": [ { "key_code": "left_control" } ],