This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/fish | |
# You can add this to your ~/.config/fish/config.fish | |
function __fish_complete_bash | |
set cmd (commandline -cp) | |
bash -c "source get-bash-completions.sh; get_completions '$cmd'" | |
end | |
# Set the tool to use bash completions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import gi | |
import datetime | |
import os | |
os.environ['GDK_BACKEND'] = 'x11' | |
gi.require_version('Gtk', '3.0') | |
gi.require_version('Gdk', '3.0') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Copyright (C) Marco Trevisan | |
# | |
# Authors: | |
# Marco Trevisan <marco@trevisan.xyz> | |
# | |
# Revision for new URL: | |
# Andrea Costantino <costan@amg.it> | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright 2019-2022 - 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Copyright 2023 - Marco Trevisan | |
# Released under the GPLv3 terms | |
# | |
# A simple tool to simulate PAM authentication using SSSD smartcard settings. | |
# | |
# To be used with softhsm2 smart cards generators from | |
# https://gist.github.com/3v1n0/287d02ca8e03936f1c7bba992173d47a | |
# | |
# Origin: https://gist.github.com/3v1n0/d7bc0f10cf44a11288648ae9d228430d |
NewerOlder