Skip to content

Instantly share code, notes, and snippets.

@bvdputte
bvdputte / migrate-translations.php
Created September 13, 2024 14:28 — forked from bezin/migrate-translations.php
Change Kirby default language from English to German with existing content files
<?php declare(strict_types=1);
use Kirby\Cms\ModelWithContent;
/**
* This script assumes English is the default language and German is the translation.
* The goal is to switch this and make German the default language and English the translation.
*
* We want to update all pages, files metadata and the site.
*
# https://joshhighland.com/2011/07/14/rename-all-files-names-in-a-directory-to-lower-case/
for i in *; do mv "$i" "$(echo $i|tr A-Z a-z)"; done
@bvdputte
bvdputte / gist:be49c6fc0a8cea172966
Created February 10, 2016 15:05
Glide - laravel route
Route::get('img/{path}', function (League\Glide\Server $server, Illuminate\Http\Request $request) {
$server->outputImage($request->getPathInfo(), $request->query->all());
})->where('path', '.+');
// Alert
// ===
.c-alert {
padding: $unit
// Success
// ---
@bvdputte
bvdputte / metadata title tag rename
Created March 1, 2013 07:23
rename file(s) naar metadata title via applescript
on run {input, parameters}
set thefile to input
try
tell application "Finder"
repeat with thefile in input
-- create variable with path from file for shell command
set tPath to quoted form of (POSIX path of thefile)
-- extract the value for the metadata tag
set command to "mdls -name kMDItemTitle " & tPath
set output to do shell script command