javascript

RFC 1123 Date Form

Today I needed a simple RFC 1123 formatted date for a date in the future and I couldn't find a form online to do the formatting for me. So instead of breaking out Perl or something I took a few minutes to whip up a JavaScript version:


I haven't tested this across browsers, but it's working for me in Firefox 3.5. Get yer RFC 1123 here! Good for HTTP headers and whatnot.
  • Google hosts several popular JavaScript libraries on their insane worldwide content distribution network. If you have faith in their uptime it could be a good way to speed up your site a bit.

Saving Myself from Myself

Do you have a bookmark you just mindlessly click all the time? I have at least one of those, and I found a way to make sure I really want to go to the site. I turned the bookmark into a bookmarklet with a JavaScript confirm before it loads. Now whenever I click a problem bookmark, I get a simple prompt: Are You Sure? If I really want to go to the site I click OK. If I was mindlessly clicking out of habit, Cancel.

If you too would like to create a time-saving mindful bookmarklet, here's how it works. Go in and edit any problem bookmark. Say for the sake of argument it's a bookmark for this URL:

http://www.google.com/reader

Add a tiny bit of JavaScript to the beginning and end of the URL, like this:

javascript:if(confirm('Are You Sure?')){document.location='http://www.google.com/reader';}

Save, and done. I'm tempted to write a Greasemonkey script to add this prompt to every link on the web because that simple barrier to entry is helping me break free from my mindless skinner box. And JavaScript prompts are less painful than classic operant conditioning with electric shocks.
  • "PhoneGap is a free open source development tool and framework that allows web developers to take advantage of the powerful features in the iPhone SDK from HTML and JavaScript."
  • A photography blog about books. [via jessamyn]
  • Some clever CSS/JavaScript hacking that determines which sites on a list someone has visited. Used for questionable good here, but could be a privacy nightmare. [via hackszine]
    filed under: hacks, javascript, privacy, ethics
  • "...good practices of pagination design as well as some examples of when and how the pagination is usually implemented." [via swissmiss]
    filed under: design, css
  • Nice JavaScript for assembling del.icio.us links HTML by hand for manual posting. I think I'll turn off auto-posts and switch to this too. [via anil]
    filed under: weblogs, javascript, writing
« Older posts  /  Newer posts »