Copying ripped TV
If you ripped a bunch of TV programmes off DVD for storage and you named them dodge, quickly copy them to the correct place with this:
Simple .debounce function
Used for delaying keypress searches, etc Usage example: Above will request /api/search endpoint 300ms after last keyup event
Loop wiring at home
I always struggle with this. Too many red and black cables and never sure where to put them. But here is a diagram which works, every time (for me anyway)…
Finding text in files in a folder
Quite often I find myself looking for files which contain the same text. Mainly config settings, etc. On linux you can use this: find ./ -type f -exec grep -l…
Calculation for working out overage
If you are trying to mathematically calculate the percentage that something was overbooked then this calculation will work: 100 x ((actual_amount - expected_amount) / expected_amount) So, if you organised a…
Auto-complete Lists in HTML5
Jquery is everywhere, its good. People like it. Its easy(ish) for beginners to create great web apps. It’s also large, and a burden if you don’t really need it. There…
HTML5 Boilerplate
Annoying to find, so a quick easy to find snippet here <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>New Page</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="description" content="Newescription" />…
MySQL / MariaDB Superuser
Simple syntax to create a super user (for editing users and dropping schemas etc) CREATE USER 'superuser'@'%' IDENTIFIED BY ''; GRANT ALL PRIVILEGES ON *.* TO 'superuser'@'%' WITH GRANT OPTION;…
MySQL Relative Time Since
You have some data which many users edit often, and you want to return a field with some sort of relative time stamp on it. For example, “27 minutes ago”…
MacOS Compact VDI file
In order to compact a virtualbox VDI file and recover some of the lost space (especially useful when using a VM for your development databases) then its really rather simple:…