Skip to content

Instantly share code, notes, and snippets.

View sod's full-sized avatar
🤨

Alexander von Weiss sod

🤨
View GitHub Profile
function getContentsRelativeFromOrigin(filename: string | undefined, depth: number) {
let path = '.';
if (!filename?.startsWith('/')) {
const stack = new Error().stack!.split('\n');
const stack3 = stack[depth].split('(');
path = stack3.pop()?.replace?.(/(:\d+)*\).*$/, '') ?? '.';
}
return () => {
#!/bin/bash
EXECUTABLE_WEBP_CHECK=$(brew ls --versions webp)
if [[ "" == "${EXECUTABLE_WEBP_CHECK}" ]]; then
echo "Error: 'cwebp' missing. Please install via 'brew install webp'"
exit 1
fi
processFile() {
prompt(10)
{
"__nghData__": [
{
"t": {
"0": "t1"
},
"c": {
"0": []
}
},