Skip to content

Instantly share code, notes, and snippets.

View nilshoerrmann's full-sized avatar

Nils Hörrmann nilshoerrmann

View GitHub Profile
/**
* ellipsisify
* @param {string} filename - The filename to be truncated.
* @param {number} lengthThreshold - (optional) The minimum length of filename to truncate.
*/
export const ellipsisify = (filename, lengthThreshold = 20) => {
// just return the filename if it's less than 20 characters long
if (filename.length < lengthThreshold) return filename;
@lukaskleinschmidt
lukaskleinschmidt / bootstrap.php
Created March 2, 2020 09:17
Kirby Thumbnails
<?php
// bootstrap/kirby.php
include dirname(__DIR__) . '/vendor/autoload.php';
$kirby = new Kirby([
'roots' => [
'base' => $base = dirname(__DIR__),
'index' => $base . '/public',
'content' => $base . '/content',