Skip to content

Instantly share code, notes, and snippets.

View RicherMans's full-sized avatar

Heinrich Dinkel RicherMans

View GitHub Profile
@RicherMans
RicherMans / alacritty-tmux-vim_truecolor.md
Created May 30, 2023 14:21 — forked from andersevenrud/alacritty-tmux-vim_truecolor.md
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@RicherMans
RicherMans / install.sh
Last active April 7, 2021 01:57 — forked from wsntxxn/install.sh
neovim and coc installing script
# 1. install neovim
echo "[step 1] installing neovim"
if command -v nvim > /dev/null; then
echo "nvim has been installed"
else
NVIM_HOME="$HOME/modules/neovim"
printf "Neovim will be installed into this location:\\n"
printf "%s\\n" "${NVIM_HOME}"
@RicherMans
RicherMans / metrics.py
Created March 1, 2021 05:47
Metrics for SED evaluation
import numpy as np
import sklearn.metrics as skmetrics
from scipy import stats
def roc(y_true, y_pred, average=None):
return skmetrics.roc_auc_score(y_true, y_pred, average=average)
def mAP(y_true, y_pred, average=None):
return skmetrics.average_precision_score(y_true, y_pred, average=average)
@RicherMans
RicherMans / test_tl.py
Created December 16, 2020 05:34
Torchlibrosa default to Librosa LMS
import librosa
import numpy as np
import torchlibrosa as tl
import torch
import soundfile as sf
y, sr = sf.read('.Y0Am7X758-Ek_30.000_40.000.wav')
# Channels normalization (if neceesary
y = y.mean(-1)
@RicherMans
RicherMans / plot_bars.py
Created August 20, 2020 06:11
Plot values on bars in sns. Found online.
def show_values_on_bars(axs):
def _show_on_single_plot(ax):
for p in ax.patches:
_x = p.get_x() + p.get_width() / 2
_y = p.get_y() + p.get_height()
value = '{:.0f}'.format(p.get_height())
ax.text(_x, _y, value, ha="center",fontsize=10)
if isinstance(axs, np.ndarray):
for idx, ax in np.ndenumerate(axs):
@RicherMans
RicherMans / download_audioset.sh
Created April 19, 2020 06:24
Download Audioset V2 with FFmpeg. Requires proxychains + Ffmpeg + gnu parallel
# @Author: richman
# @Date: 2018-03-15
# @Last Modified by: richman
# @Last Modified time: 2018-03-30
if [[ $# < 1 ]]; then
echo "Input .csv file .e.g balanced_train_segments.csv"
exit
fi
@RicherMans
RicherMans / install.sh
Last active February 5, 2020 07:36
V2ray AutoInstaller for myself
#!/usr/bin/env bash
[[ $EUID -ne 0 ]] && echo -e "[${red}Error${plain}] This script must be run as root!" && exit 1
error() {
echo -e "
Error
$1
"
}
@RicherMans
RicherMans / debloat.txt
Last active December 2, 2023 09:52
debloat
pm uninstall --user 0 com.android.browser
pm uninstall --user 0 com.android.mail
pm uninstall --user 0 com.android.providers.partnerbookmarks
pm uninstall --user 0 com.android.bips
pm uninstall --user 0 com.xiaomi.joyose
pm uninstall --user 0 com.miui.vsimcore
pm uninstall --user 0 com.miui.bugreport
pm uninstall --user 0 com.miui.cleanmaster
pm uninstall --user 0 com.miui.translation.xmcloud
pm uninstall --user 0 com.miui.translation.kingsoft
@RicherMans
RicherMans / Icons.txt
Created January 30, 2020 04:12
Icons.txt
com.google.android.youtube
com.eg.android.AlipayGphone
com.dianping.v1
com.android.calendar
@RicherMans
RicherMans / config.json
Created January 26, 2020 03:43
v2ray server config
{
"log": {
"loglevel": "warning", // 日志级别
"access": "/var/log/v2ray/v2ray_access.log",
"error": "/var/log/v2ray/v2ray_error.log"
},
"inbound": {
"port": 41335, // 服务器监听端口,必须和上面的一样
"protocol": "vmess",
"settings": {