View .zshrc
typeset -g MY_ZSH_CONFIG_PATH=${ZDOTDIR:-$HOME/.config/zsh} | |
typeset -g MY_ZINIT_PATH=${ZDOTDIR:-$HOME/.local/share}/zinit | |
HISTFILE=$MY_ZSH_CONFIG_PATH/zsh_history | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
if [ ! -f $MY_ZINIT_PATH/bin/zinit.zsh ] && ((${+commands[git]})); then |
View fattura-elettronica-imap-extractor.py
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright 2019 - Marco Trevisan | |
# | |
# A Tool to export your invoices in the Italian electronic Fattura Elettronica | |
# format from any IMAP PEC provider (defaulting to Aruba PEC) to your computer | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
View map-string-any-kotlin-serialization-tests.kt
import kotlinx.serialization.* | |
import kotlinx.serialization.descriptors.SerialDescriptor | |
import kotlinx.serialization.encoding.CompositeDecoder | |
import kotlinx.serialization.encoding.Decoder | |
import kotlinx.serialization.encoding.Encoder | |
import kotlinx.serialization.json.* | |
import kotlin.reflect.KType | |
import kotlin.reflect.full.isSubtypeOf | |
import kotlin.reflect.full.starProjectedType |
View pulse-audio-hdmi-switch.sh
#!/bin/bash | |
USER_NAME=$(who | grep tty$(sudo fgconsole) | cut -f1 -d' ') | |
USER_ID=$(id -u "$USER_NAME") | |
HDMI_STATUS=$(</sys/class/drm/card0/*HDMI*/status) | |
HDMI_CARD="pci-0000_00_03.0" | |
HDMI_PROFILE="hdmi-stereo-extra1" | |
INTERNAL_CARD="pci-0000_00_1b.0" |
View canoninvoice.py
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# | |
# 2019-2021 - Marco Trevisan | |
# | |
# Fattura Elettronica and python Playground | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or |
View vscode-unused-workspace-storage-cleanup.sh
#!/bin/bash | |
CONFIG_PATH=~/.config/Code | |
for i in $CONFIG_PATH/User/workspaceStorage/*; do | |
if [ -f $i/workspace.json ]; then | |
folder="$(python3 -c "import sys, json; print(json.load(open(sys.argv[1], 'r'))['folder'])" $i/workspace.json 2>/dev/null | sed 's#^file://##;s/+/ /g;s/%\(..\)/\\x\1/g;')" | |
if [ -n "$folder" ] && [ ! -d "$folder" ]; then | |
echo "Removing workspace $(basename $i) for deleted folder $folder of size $(du -sh $i|cut -f1)" |
View python.vapi
[CCode (lower_case_cprefix = "Py_", cheader_filename = "Python.h")] | |
namespace Python | |
{ | |
public void Initialize (); | |
public void Finalize (); | |
[CCode (lower_case_cprefix = "PyRun_")] | |
namespace Run | |
{ | |
public void SimpleString (string @string); |
View fitbit-svg-to-grayscale-magic-png.sh
#!/bin/bash | |
# Simple script to convert SVG icons to fitbit grayscale magic compatible PNGs | |
# Usage: convert-svg.sh [icons-path] | |
# | |
# Author: Marco Trevisan (Treviño) <mail@3v1n0.net> | |
# Licensed under GPLv3 | |
PNG_SIZE=${PNG_SIZE:-80} | |
icons_path=${1:-$(dirname "$0")} |
View keybindings.json
/* VSCode keybindings for alternative HJLK navigation, when using non-vim mode | |
* and support for quick panel navigation with Tab/Shift+Tab. | |
* | |
* So basically I just tried to use everywhere in the editor these aliases: | |
* Alt+j = down | |
* Alt+k = up | |
* Alt+l = right | |
* Alt+h = left | |
* Alt+b = previous-word | |
* Alt+w = next-word |
View vscode-keybindings-alt+hjkl-zation.py
#/usr/bin/python3 | |
import json | |
import sys | |
import os | |
import re | |
import copy | |
input = sys.argv[1] |
NewerOlder