Skip to content

Instantly share code, notes, and snippets.

View wsntxxn's full-sized avatar
🎯
Focusing

Xuenan Xu wsntxxn

🎯
Focusing
View GitHub Profile
@wsntxxn
wsntxxn / init.vim
Created October 29, 2020 14:27
neovim initialization file
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
set clipboard=unnamedplus " Use system clipboard
set cursorline " Highlight the cursor line
set hlsearch
@wsntxxn
wsntxxn / install.sh
Last active March 21, 2022 12:54
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}"
@wsntxxn
wsntxxn / download_audioset_video.sh
Created November 21, 2021 07:36
Download audioset video dataset with yt-dlp and ffmpeg.
#!/usr/bin/env bash
# Please first configure your ~/.config/youtube-dl/config
# Specifically add aria2c for parallel download
# e.g.,
# --external-downloader aria2c
# --external-downloader-args '-c -j 3 -x 3 -s 3 -k 1M'
if [[ $# < 1 ]]; then
echo -e "Input: [.csv file] [download path] [proxy]"
@wsntxxn
wsntxxn / download_audioset_video.py
Last active March 24, 2024 22:01
download audioset video using yt-dlp.
import argparse
import os
import time
import random
from pathlib import Path
import yt_dlp
from yt_dlp import DownloadError
import timeout_decorator
from timeout_decorator.timeout_decorator import TimeoutError
@wsntxxn
wsntxxn / config_parser.py
Last active December 7, 2022 03:17
Argument parser to parse parameters in configuration files. Convenient modification based on command lines are supported.
import os
import fire
import toml
import yaml
def merge_a_into_b(a, b):
# merge dict a into dict b. values in a will overwrite b.
for k, v in a.items():
if isinstance(v, dict) and k in b: