Blog

Mk2 R32

Mk2 R32
My new toy, a MK2 golf with a difference, this one has an Audi 3.2 liter V6, MK3 VR6 dash, VR6 breaks, coilovers, emerald ECU and custom exhaust  :)

Drupal 8 Dynamic Dependent Views Exposed Filter Dropdowns

Drupal 8 Dynamic Dependent Views Exposed Filter Dropdowns
I recently needed to make a Drupal-8 view with the exposed filters filtered by the existing filters so there are no zero results pages available.Here's the PHP for that, you'll also need to target your filter form and add an on change event to submit the filter form else you can still get the no result pages.My view is a view of content teaser with 3 referenced vocabs on the content type.Firstly I duplicated the entire view and called it the same as the first on with "Count" on the end and changed it to have no limit to the number of results returned and also to just return fields and only the title field.This was because without it I wasn't getting the full list of terms I could filter byAl

Ampache auto skip

Auto-Skip TamperMonkey/GreaseMonkey script for corrupt MP3s My Ampache web player gets stuck one second before the end of some MP3 tracks because the file headers say that it is one second longer than the stream actually is. This script runs in the browser and checks to see if there is still one second to go and also that the play button is visible. This is the case when an MP3 is corrupt for me and so this script just presses the skip button so I can still enjoy my albums without having to look at the player. Please feel free to make it better and post back the changes so I can improve my own experience, thanks :) // ==UserScript== // @name Ampache Autoskip

Caching Module

Caching Module
Loading menus and rendering content in Drupal can be slow, especially if your menus are large, you have allot of entities on a single page or the rendering causes allot of database lookups for getting path aliases or similar.  Below is a simple module that aloows you to cache both menus and rendered content by using a the "caching_cache_render" function instead of "render" and "caching_cache_menu_tree" instead of "menu_tree".  There are then controls for you to set whether the caching takes place or not and the duration the items are cached for in the admin area at "/admin/config/development/performance/caching". 

Recursive Image Viewer

Recursive Image Viewer
If you have ever wanted to see all the images in your files directory or from a package that contains multiple directories, each with multiple images or subdirectories that may or may not contain images more images then this may help you.  This is a very simple script that recursively scans a directory for images and then makes a HTML page displaying all these images on a single page to make browsing as easy as possible.  To save your browser from crashing the images are lazy loaded as you scroll down and to fit as many on the page as possible there is a max width set on each image and I am using CSS Flex to give a little order to the chaos. 

Pages