David Preston

Musings of an old bloke.

I'm Available

Posted about 2 months ago (13 October 2016 9:34 pm) by David Preston

So, I find myself 'between jobs'. As of today's date one is available for work.

On the off-chance that you need a developer, get in touch. A developer, specifically who can make you a website that you can edit on your phone, as I did creating this post.

I hope you're impressed. If you are (even a bit), you can learn more about me at LinkedIn or Stack Overflow.

Join the Discussion

Categories: Web Development

Tags: gizzajob

How to Insert a Space Character in HTML

Posted about 9 months ago (25 February 2016 5:32 pm) by David Preston

A space, not a non-breaking space, just an ordinary space. Can't be that hard, can it? Well, you would think so. Or I'm rubbish at googling the right thing.

I was working on a project at work, and adding schema.org markup which involved wrapping stuff in <span>s. Which in turn choked my HTML minifier and caused one particular space to disappear. Took me ages to find the solution; how to actually insert an entity for a space.

It's &#32; yup 32, those of us who are old enough remember 32 is the ASCII code for a space. Obvious, eh?

Join the Discussion

Categories: Web Development

Tags: html

Filetype Associations in FileZilla Portable

Posted about 10 months ago (13 February 2016 12:39 pm) by David Preston

This is one of those posts that is more of an aide-mémoire for me than anything else, although I will be pleased if it helps anyone else.

The background was that I was going to write another blog post (not this one), but before then I wanted to change the width of the .container div and make it a bit wider. But I couldn't remember my own ftp login (embarrassing). So, Pro Tip 1, hi thee along to portableapps.com and set up a USB thumb drive with a few useful apps, including FileZilla Portable, Notepad++ Portable and IrfanView Portable. There are loads of others as well, but these three form the crux of this story.

"But why" I hear you ask, "portable versions?". Good question. Plenty of reasons, not least being guaranteed availability of programs you need and are familiar with, plus you (I) can save your (my) ftp password in my portable FileZilla and never need to remember it. TBH I don't even know it; I reset it on my hosting control panel using LastPass in Chrome, but that doesn't work in desktop programs (so far as I know) and just copy/pasted it into FZ.

Right, so that's that sorted. Now to edit my site's CSS. Open the hosting in FZ, right-click main.css and click View/Edit. And Aptana Studio opens up (in its own good time) from my hard drive. Well, that's a bit rubbish. Nothing against Aptana per se, but I stopped actually using it ages ago. Atom is my current development editor of choice, with Notepad++ for quick edits to almost anything. So in my desktop instance of FZ at work I have NP++ set as default editor for everything, and it would be nice to have FZ Portable use other portable apps on the thumb drive to open files for editing.

After Googling around a bit, I found this Superuser answer for a different portable platform, which gave me enough help to solve my problem. What I ended up with was in FZ Portable, go to 'Settings - File editing - Filetype associations' and enter these lines -

php "..\Notepad++Portable\Notepad++Portable.exe"
css "..\Notepad++Portable\Notepad++Portable.exe"
js "..\Notepad++Portable\Notepad++Portable.exe"
. "..\Notepad++Portable\Notepad++Portable.exe"
inc "..\Notepad++Portable\Notepad++Portable.exe"
txt "..\Notepad++Portable\Notepad++Portable.exe"
md "..\Notepad++Portable\Notepad++Portable.exe"
ico "..\IrfanViewPortable\IrfanViewPortable.exe"
jpg "..\IrfanViewPortable\IrfanViewPortable.exe"
png "..\IrfanViewPortable\IrfanViewPortable.exe"
webp "..\IrfanViewPortable\IrfanViewPortable.exe"
gif "..\IrfanViewPortable\IrfanViewPortable.exe"

Line 4 was interesting. I originally had htaccess and gitignore as file types, but that didn't work as FZ sees them as '.' files. Anyhow, all those file types now open in their respective portable colleagues.

Join the Discussion

Categories: Web Development

Tags: FileZilla, PortableApps, IrfanView, Notepad++

ProcessWire & CloudFlare

Posted about 1 year ago (19 August 2015 10:29 am) by David Preston

Erudite (or nosy) visitors may have noticed that I run this blog through a free CloudFlare account. This is a Good Thing, however it was breaking my ProcessWire admin (not a Good Thing), with the default CloudFlare optimisations.

It turns out that the trick is to create a CloudFlare 'Page Rule' for dpreston.com/processwire/* (the asterisk wildcard character is important), such that the rule description reads 'Apps: Off, Performance: Off, Security: On, Cache level: Bypass cache'.

Then it all works again. Phew.

Join the Discussion

Categories: Web Development

Tags: Processwire

A 'Wow' & Two 'wtf?'s - My Day Using Google

Posted about 2 years ago (13 February 2015 4:05 pm) by David Preston

I use Google a lot - most people probably do. Usually nothing worth even a raised eyebrow comes of it but today has been significantly different. The big G has thrown me a series of curveballs all day.

First off, some background - this morning I bought tickets to watch Chic at the Apollo in Manchester next month. The resulting emails arrived in my Gmail inbox and were duly archived. Google Map with personalised contentSomewhat later I realised I had no idea of the Apollo's location in Manchester, so I hopped on Google. What I saw on the Google Maps page made me smile. The email had had the date and time of the gig, and Google had read (and understood) this information and presented a reminder on the page. That's definitely a 'wow'. I fully expect that my phone will remind me about the gig as well, when the time comes, although I want to leave that as a surprise so I haven't checked.

Google postcode serpsNow the first 'wtf'. I was googling a postcode and noticed the description (in the image). WTF Google? Your own robots.txt file excludes your own crawler? I did try to have a look at the Google Maps robots.txt file but it was a 404. Which is a bit of a wtf in itself.

Google Cricket World Cup widgetSecond 'wtf' is a cracker. Google is currently (at the time of writing) showing a Google Doodle to mark the start of the Cricket World Cup. When you click on said image, it takes you to a SERPs page about the competition, headed by the widget shown in the image. Which is all fine and dandy until you notice the note at bottom right (highlighted). "All times are in British Summer Time". Google, you're drunk.

It's February. British Summer Time (daylight saving time elsewhere in the world) doesn't start until the last weekend in March, when the clocks go forward one hour. So, the times in that widget, are they really GMT+1? Or is the note just bunkum? WTF?

Join the Discussion

Categories: Uncategorised

Tags: Google