This file contains hidden or 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 hidden or 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 | |
| # Simple script to convert SVG icons to fitbit grayscale magic compatible PNGs | |
| # Usage: convert-svg.sh [icons-path] | |
| # | |
| # Author: Marco Trevisan (Treviño) <[email protected]> | |
| # Licensed under GPLv3 | |
| PNG_SIZE=${PNG_SIZE:-80} | |
| icons_path=${1:-$(dirname "$0")} |
This file contains hidden or 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 hidden or 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 [ ! -f $MY_ZINIT_PATH/bin/zinit.zsh ] && ((${+commands[git]})); then | |
| __zinit_just_installed=1 | |
| mkdir -p $MY_ZINIT_PATH && chmod g-rwX "$MY_ZINIT_PATH" && \ | |
| git clone --depth=1 https://github.com/zdharma/zinit.git $MY_ZINIT_PATH/bin | |
| fi |
This file contains hidden or 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 hidden or 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
| #include <errno.h> | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| #include <stdlib.h> | |
| #include <fcntl.h> | |
| #include <liburing.h> | |
| typedef enum { | |
| TEST_URING_OP_NONE = 0, |
This file contains hidden or 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
| function argbToRgba(src, inline=false) { | |
| let dest = inline ? src : new Uint8Array(src.length); | |
| let srcView = new DataView(src.buffer); | |
| let destView = new DataView(dest.buffer); | |
| for (let i = 0; i < src.length; i += 4) { | |
| let argb = srcView.getUint32(i); | |
| let rgba = (argb & 0x00FFFFFF) << 8 | | |
| (argb & 0xFF000000) >>> 24; | |
| destView.setUint32(i, rgba); |
This file contains hidden or 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 hidden or 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/python3 | |
| import json | |
| import sys | |
| import os | |
| import re | |
| import copy | |
| input = sys.argv[1] |
This file contains hidden or 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
| <!-- | |
| To associate the Italian Electronic Invoices (Fattura Elettronica) to a given | |
| program, copy this to | |
| ~/.local/share/mime/packages/fattura-elettronica.xml | |
| And run | |
| update-mime-database ~/.local/share/mime | |
| Then those .xml files may have a different behavior than standard .xml files | |
| --> |