MLNTN

Maniacal musings of a pixel perfectionist

HUMOR: jQuery LOLCAT plugin

Posted by Jared on January 19, 2011 1 COMMENT

I had an idea for a site easter egg recently where a user would enter some key combination and all of the text would be translated into LOLCAT. As I usually do, I started off with a Google search for “jquery lolcat”. Nothing useful. Continue reading…

I recently had to disable some forms if a certain case existed and I came up with a hilarious way to use the same code for PHP and Javascript. Sometimes, amusing myself is how I get through a day. Continue reading…

2009 recap

Posted by Jared on January 1, 2010 1 COMMENT

Since 2009 has come to a close, I’d like to reflect on some of the cool stuff I’ve been able to work on over the past year. Continue reading…

jQuery IP address plugin

Posted by Jared on December 30, 2009 32 COMMENTS

It’s pretty tough to handle IP addresses in HTML forms. Sure, you can do have 4 separate inputs and have users tab between them. You could setup one input and validate it on the server side. You could even use a tool like Masked Input to force users to match a specific format.

But all of those solutions fall short in one way or another. Continue reading…

Google Chrome’s extension gallery opened December 8th and the race to create extensions is on.

I browsed through the gallery, looking for anything that might be useful to me and my normal browsing experience. I found a couple good ones: Google Alerter, RSS Subscription Extension and Docs PDF/PowerPoint Viewer (by Google).

I searched for a Facebook ad blocker, but the one I found only blocked profile ads – not very useful. So I tried writing my own and found that it was much simpler than I expected. Continue reading…

jQuery undo plugin

Posted by Jared on March 9, 2009 5 COMMENTS

I got a crazy idea when I was working with some AJAX interfaces – a quick and painless jQuery undo plugin.

What does that mean? I’m not entirely sure. Continue reading…

jQuery zoom event plugin

Posted by Jared on December 11, 2008 9 COMMENTS

I don’t normally write code that I’m not ready to use, but I made an exception for this jQuery plugin.  It doesn’t really do all that I wanted it to do, but it’s good enough for a release.
Continue reading…

The start of a jQuery zoom event handler

Posted by Jared on December 11, 2008 2 COMMENTS

After much research and very little code, I’ve come up with a basic start to a jQuery zoom event handler.  Don’t laugh.  This is very basic, but it handles zoom events based on keyboard shortcuts and fires the handler.
Continue reading…

Simple date conversion from SQL to readable

Posted by Jared on December 2, 2008 ADD COMMENTS

I needed a simple date converter function from SQL dates (YYYY-MM-DD) to something readable (M/D/YYYY).  So I wrote this little function.  Maybe someone else will have some use for it.

var makeSQLDatePretty = function(d) {
  return d.replace(/([0-9]{4})-0?([0-9]{1,2})-0?([0-9]{1,2})/, '$2/$3/$1');
};

Pass in a SQL date and the function trims leading zeros and returns a reformatted date.

var sqlDate = '2008-12-02';
alert(makeSQLDatePretty(sqlDate)); // should alert '12/2/2008'

Crazy Europeans may want to change the replace regex with ‘$3/$2/$1′.

Smart, unobtrusive AJAX form submission with jQuery

Posted by Jared on September 22, 2008 5 COMMENTS

A former coworker was telling me recently about MooTools and how the AJAX functions are so easy to use.  He sent me the following example:
Continue reading…