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
# Ellipsizes a path to display it in a limited space. | |
function ellipsize() { | |
(( ${#1} <= 40 )) && { print -r -- $1; return } # If the path is short enough, just return it. | |
local array=(${(s:/:)1}) # Split the path into an array. | |
local head=() tail=() # The head and tail of the path. | |
local prefix='' # '/' if the path is absolute, '' otherwise. | |
[[ ${1[1]} == '/' ]] && prefix='/' # If the path is absolute, set the prefix. | |
local next=tail # The next part of the path to be added. | |
local result # The result. | |
local elm # The current element being processed. |
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
#!/data/data/com.termux/files/usr/bin/env lua | |
-- Escape a string for use in a shell command | |
local function shell_escape(args) | |
local ret = {} | |
local s | |
for _, a in pairs(args) do | |
s = tostring(a) | |
if s:match("[^A-Za-z0-9_/:=-]") then | |
s = "'" .. s:gsub("'", "'\\''") .. "'" |
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/env -S perl -CSDA | |
# Multiply the time values in a CUE file by a factor. | |
use strict; | |
use warnings; | |
use utf8; | |
use autodie; | |
use Getopt::Long qw(:config posix_default no_ignore_case gnu_compat); |
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/env -S perl -CSDA | |
use 5.03; | |
use strict; | |
use warnings; | |
use utf8; | |
use open ':std', ':encoding(UTF-8)'; | |
use URI; | |
use IPC::Open2; |
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
{ pkgs ? import <nixpkgs> { } }: | |
let | |
audiotok = with pkgs.python3Packages; buildPythonPackage rec { | |
pname = "auditok"; | |
version = "0.1.5"; | |
src = fetchPypi { | |
inherit pname version; | |
sha256 = "sha256-HNsw9VLP7XEgs8E2X6p7ygDM47AwWxMYjptipknFig4="; | |
}; | |
propagatedBuildInputs = [ |
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/env bash | |
THIS_SCRIPT="$(realpath "$0")" | |
set -eu -o pipefail | |
build_container() { | |
CONTEXT="$(mktemp -d)" | |
trap 'rm -rf "$CONTEXT"' EXIT | |
sed -nE '/^# INCIPIT DOCKERFILE/,$p' < "$THIS_SCRIPT" > "$CONTEXT/Dockerfile" |
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
{ | |
pkgs, | |
lib, | |
... | |
}: let | |
listenHost = "127.0.0.1"; | |
listenPort = 3000; | |
hmac_key = "0mwSVDxp8YhEuPvuxsUCoqhZBDQOys4U"; | |
repo = fetchGit { | |
url = "https://github.com/iv-org/invidious"; |
OlderNewer