Skip to content

Instantly share code, notes, and snippets.

View pekka's full-sized avatar

Pekka Gaiser pekka

View GitHub Profile
@pekka
pekka / scaleToCoverX.js
Created November 23, 2017 21:32
Fancybox "scale to cover 100% width" function
// Scale image to cover X
// ===========================================
scaleToCoverX : function( x, y, duration ) {
var self = this;
var current = self.current;
var $what = current.$content;
@pekka
pekka / TaskObserver.php
Last active October 17, 2023 09:15
Addition to Laravel Daily's mini tutorial "Filament & Laravel: Delete Unused Files if Model is Updated/Deleted" - a "saved()" method that can handle the image field set to multiple
public function saved(Task $task): void
{
if ($task->isDirty('attachment')) {
$originalFieldContents = $task->getOriginal('attachment');
$newFieldContents = $task->attachment;
# We attempt to JSON decode the field. If it is an array, this is an indication we have ->multiple() activated
$originalFieldContentsDecoded = json_decode($task->getOriginal('attachment'));
Alegranza
Casa del Veril, La
Cerca de las Pencas
Cerca del Millo
Cerca el Jablillo
Cerca el Mato
Cerca Vieja
Corral del Veril
Corral Grande
@pekka
pekka / gist:676f3b77802942267f981651b505dc25
Created November 14, 2023 16:00
Listado de poblaciones de Lanzarote
Fuente de datos: Toponimia de Lanzarote
https://toplanzarote.ulpgc.es/listado.php?tipo=3
Alegranza
Casa del Veril, La
Arrecife
Fuente de datos: Toponimia de Lanzarote
https://toplanzarote.ulpgc.es/listado.php?tipo=3
Alegranza
Casa del Veril, La
Arrecife