Skip to content

Instantly share code, notes, and snippets.

View SirWrexes's full-sized avatar

Ludovic Fernandez SirWrexes

View GitHub Profile
@cniw
cniw / mpv-full-git.txt
Last active January 20, 2022 12:07
Build mpv package with luajit support for Arch Linux
# set variable
_pkgbase=mpv-full-git
_pkgbase_cache_dir="$HOME/.cache/yay"
_repo_cache_dir="$HOME/Applications/git"
_git_url=https://github.com/mpv-player/mpv.git
_git_repo="${_git_url%%.git}"
_git_repo="${_git_repo##*.com/}"
# prepare source code
[ -d "${_pkgbase_cache_dir}" ] || mkdir -p "${_pkgbase_cache_dir}"
@zachlysobey
zachlysobey / partition.ts
Last active April 6, 2023 16:33
TypeScript array `partition` utility
/**
* Takes a predicate and a list of values and returns a a tuple (2-item array),
* with each item containing the subset of the list that matches the predicate
* and the complement of the predicate respectively
*
* @sig (T -> Boolean, T[]) -> [T[], T[]]
*
* @param {Function} predicate A predicate to determine which side the element belongs to.
* @param {Array} arr The list to partition
*