From c3f82eb47190455220a0a71dd9176f905f782421 Mon Sep 17 00:00:00 2001 From: TheK4n Date: Tue, 9 Aug 2022 22:05:11 +0300 Subject: [PATCH] bash func rayso --- sub/bash/functions | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sub/bash/functions b/sub/bash/functions index 8b591cc..13fd0cd 100644 --- a/sub/bash/functions +++ b/sub/bash/functions @@ -217,4 +217,14 @@ split-file() { (mkdir "$1.splitted" && cd "$1.splitted" && split -d -b "$_size" "../$1") } +# returns url to code previewer +rayso() { + test -z "$1" && return 1 + local CODE FILENAME + + CODE="$(cat "$1" | base64)" + FILENAME="$(basename "$1")" + + echo "https://ray.so/?colors=candy&background=true&darkMode=true&padding=64&title=${FILENAME}&code=${CODE}&language=auto" +}