We are all familiar with the daylight saving time. Once every year we are happy that we earn a sleeping hour and once the exact opposite.
So what pushed me to blog about it?
I had to hack a small bash script at work, so it will accept a date command line argument, to export that date reports. Piece of cake, right?
Done quickly with this simple hacking and thought to add some user input validation. Why not validate user input with the date tool? If date believes a date is invalid, then it is.
And ready to go! User request asked to use this small script and export for him three past dates reports.
More valid dates than ever! Except from 03/03/10 that date believed it’s invalid!
How this can be possible! What’s so special about 03/03/10.
Googling around brought to my notice, that if you don’t specify to date that you want UTC ( -u ) it will work with your local system timezone and daylight saving times. So date 03/03/10 00:00:00 could really be invalid? It could if the DST for Eastern Standard Time was happening that day and time.
Although, this could be a great explanation for my problem, that wasn’t the case. I was using a really old version of cygwin’s date (probably not even a GNU version), that was just buggy and was reporting invalid date even with -u switch.
I may end-up in an dead end. But next I will be really careful when using local times 🙂
There are two grate add-ons for Mozilla Firefox, that is a must for every web developer. I’m almost sure you know them.
These are great tools even for non full time web developers. But they can impact your every day Internet browsing experience, by making Firefox more sluggish or just because they “pollute” your beautiful interface. In other cases, everyday add-ons that make your browsing experience easier ( ads blockers, socialization stuff, … ) may harm your development process.
Considering all these, and because disabling each time the relative add-ons isn’t so convenient, I thought of using different Firefox Profiles for each job.
Profiles, are available from the early ages of Mozilla browser, but never found a reason to use it. It’s main reason of existence is to allow different users, use their own personal settings in the browser, but this is almost handled by OS’s multi-user capabilities.
What if the same person has multiple roles? Maybe a profile for each role could help.
- So, I popped up Profile Manager and created a new Development profile.
- Installed my development add-ons. Setup my interface and bookmarks to development needs.
- A special Firefox Developer shortcut.
firefox -p Developer -no-remote
That’s it! A small inconvenience, of this setup is that if I run my Development profile Firefox first and then try my default profile from it’s shortcut, a new Development profile Firefox tread will pop up. That’s because the default Firefox shortcut doesn’t use the -no-remote argument. But you can just add it your self 🙂
If only I could change my new profiles application icon 🙁
according to this, it doesn’t seem possible: https://support.mozilla.com/en-US/forum/1/559678