Dominic Myers writes about all sorts of stuff to do with HTML, CSS, JavaScript and a fair chunk of self-indulgent stuff. Thoughts and opinions are all his own, and nothing to do with any employer.
Tuesday 28 October 2014
Sunday 19 October 2014
Redness of the Eye - check the symptoms
My right eye hurt like crazy last weekend but I figured it was okay as it felt a wee bit like I'd got some sand in it. Then, about 14:00hrs yesterday, it started hurting again. Once is unusual but twice is really rather concerning as I couldn't stand changes in brightness and it was not only stinging but really quite sore and getting redder and redder - there's a family history of glaucoma as well - so I was really quite concerned... especially after reading up on Acute angle-closure glaucoma; so was NHS Direct when I finally rang them about midnight last night and they said I should get to A & E within an hour. Proper brown trouser moment that was. That and the odd SMS from #2 meant that I was rather frantic!
Anyway I'm very grateful to the NHS for sorting me out. I waited a fair bit but was given Paracetamol and 'er indoors was an absolute trooper as I'm not used to being ill and was a wee bit of a tart, I've got to say. They said it didn't seem like the old cute glaucoma but that I should attend Addenbrooke's at 09:30 this morning to get checked out by a proper eye Doctor. This we did - with trousers of a slightly lighter shade of brown - and it seems as though I've got Uveitis.
An easy mistake to make as the symptoms are similar:
Uveitis Symptoms
- a painful red eye – the pain can range from mild aching to intense discomfort, and reading or other tasks that require you to focus your eye can make the pain worse
- blurred or cloudy vision
- sensitivity to light (photophobia)
- floaters – shadows that move across the field of vision
- loss of peripheral vision – the ability to see objects at the side of your field of vision
- seeing flashing lights
Acute angle-closure glaucoma Symptoms
- intense pain
- redness of the eye
- headache
- tender eye area
- seeing halos or 'rainbow-like' rings around lights
- misty vision
- loss of vision in one or both eyes that progresses very quickly
(strong: what I had)
I think the thing that convinced them that I wasn't about to go blind was that my eye-sight hadn't and didn't worsen. In fact it's actually really rather good considering I use gems!
I spent the evening cursing my dear old Ma as she has glaucoma, as did her Dad... turns out though it was the wrong parent: I should've been cursing as my Old Man as he gets Iritis (another name for Uveitis apparently)... probably down to his rabid immune system, which I also share. Arse!
How does that work anyway? How come there's one disease that sounds so like the organ it afflicts? Did someone get in there first and decide that the illness s/he'd discovered should be called Iritis and bugger everyone else? And what about other diseases? Did the poor bugger who researched piles not think to call it Arseitis? The list goes on... Athletes Foot could be Footitis... ahh well.
Another interesting question was about pain - I kept being asked to gauge the pain in my eye between 1 and 10 with 10 being the most pain I've ever felt... what with inheriting my Dad's immune system and it's tendency to attack my body I've not really had much experience of never being at some level of discomfort (no sympathy required - though I'd suggest reading Charlie Stross's post about reaching the age of 50 and why grumpy old men are grumpy ;-)). Sometimes I think it's only being uncomfortable that lets me know I'm alive... but proper, acute, agonising pain... never given birth so I wouldn't know - been kicked in the nuts and had other things that have made the sweat break out on my forehead but nothing like a level 10. That and I'm a big girl's blouse!
I'm also having to wear shades indoors and close the curtains and turn the brightness down on the monitor I'm using to write this... and have a wee kip afterwards to rest my poor battered eye. Ohh joy - and driving might be an issue until my eyes get used to the huge quantities of steroids I'm going to have to take for the next 6 weeks!
Saturday 18 October 2014
Twig filter to convert duration in minutes to ISO 8601 formatted duration string
I was gonna write this myself but instead borrowed heavily (stole shamelessly) from Eric's answer on stackoverflow. Once it's registered with $twig
then simply call it like this:
datetime="{{ session.duration|minutes_to_iso8601_duration }}"
And you'll have a nicely acceptable datetime attribute for your HTML durations... if that's your thing that is ;-).
$filter = new Twig_SimpleFilter('minutes_to_iso8601_duration', function ($minutes) { $time = strtotime($minutes . "minutes", 0); $units = array( "Y" => 365*24*3600, "D" => 24*3600, "H" => 3600, "M" => 60, "S" => 1, ); $str = "P"; $istime = false; foreach ($units as $unitName => &$unit) { $quot = intval($time / $unit); $time -= $quot * $unit; $unit = $quot; if ($unit > 0) { if (!$istime && in_array($unitName, array("H", "M", "S"))) { $str .= "T"; $istime = true; } $str .= strval($unit) . $unitName; } } return $str; });
If you need to update the value on screen then I use Moment.js like this:
$("#session_duration").attr("datetime", moment.duration(parseInt(data.duration, 10), "minutes").toISOString());
I'm not sure why it was so important for me to have this but I'm very glad I've got valid HTML5 pages now! The standard is interesting as well!
Sunday 12 October 2014
First all gold!
My first all gold, the next was also all gold but not as a high a score... ahh well.
Distance: 30 yds
When | 1st | 2nd | 3rd | 4th | 5th | 6th | Total | Gold |
---|---|---|---|---|---|---|---|---|
12/10/2014 14:52 | 10 | 10 | 10 | 10 | 9 | 9 | 58 | 6 |
12/10/2014 14:58 | 10 | 10 | 9 | 9 | 9 | 9 | 56 | 6 |