Archive for the 'JavaScript/CSS' Category

CSS Optimizer

nirav April 2nd, 2007

Ashok S, our designer sent this:

If you want to optimize your CSS code, checkout the CSS Optimizer on flumpcakes. It is an online tool which helps you delete unwanted css code.

From their about page, the tool essentially does the following:

  • Removes comments
  • Removes white space (such as excess spaces)
  • Converts RGB values to Hex (they’re smaller)
  • Converts Hex values in the format #RRBBGG to #RGB.
  • Changes zero values with a size specified to 0. (0px would change to 0)
  • Changes values such as border: 1px 2px 1px 2px; to border: 1px 2px;
  • Converts multiple background, font, margin, padding, list attributes into a single attribute
  • Converts multiple border values into single attributes
  • Option to convert absolute values (PX & PT) into relative values (EM)
  • Groups style attributes and values which appear multiple times into a single style

24 ways to impress your friends

nirav May 4th, 2006

http://www.24ways.org/

A super collection of 24 articles that show cool things about AJAX. JavaScript and CSS tricks, add-ons to your website and more. A great resource to learn more about AJAX.

Thanks Kartik!

ThunderBird and OPML

January 2nd, 2006

I have been looking at Thunderbird plugins today and I am not feeling excited. Unlike Firefox, Thunderbird does not have a lot of plugins. The ones which are there, did not seem good enough. I was particularly looking like an RSS aggregator. Now ThunderBird does a nice job of managing RSS subscriptions and showing the stories. What I wanted, was to import an OPML file from my current RSS Aggregator and let ThunderBird manage the feeds. This way I can eliminate one running application and save on some resources.

I tried Forumzilla, but it did not work. I couldn’t figure out how to get it to work. It did not even import my OPML file.

I read about newsblog.jar on Dougal Campbell’s blog. Many people wrote about it, including Wayne Graham and Gumuz.
Dougal has basically added some functions to a JavaScript file in the newsblog.jar file that provide OPML import / export. I thought of giving it a try.

So I replaced the file in my chrome folder, and launched Thunderbird. Sure enough, there were “Import OPML” and “Export OPML” buttons on Subscription Management. So I tried to import the OPML I had. Didn’t work! I then exported my current subscription to see how that OPML looked like. I changed my OPML file to have the same structure as the exported one, but that too did not succeed. I tried a lot of combination but all failed.

After a few restarts, I thought of figuring out this myself. So opened up the jar file (it’s actually a zip file) and checked up subscription.js. It seemed normal! Then I thought about looking at any messages that may be coming up in the process. Opened up the JavaScript Console from Tools, and saw a few messages that said something similar to “body[0] is undefined”. I cleared up the JavaScript console and thought of trying this again to see what really goes on.

I also made sure that the outline tag comes on a new line after the body tag.

Went to import, and chose the file. And it worked!

Now, don’t ask me why did it work! I don’t know myself! I think it was just testing my patience!

Here are a few things that I learnt on the way:

  • Forumzilla needs a folder to store the feed in. The default settings won’t work. But if you create a folder within “News & Blogs” and assign that, it will be able to download the feed properly.
  • Thunderbird too has JavaScript Console, and it can be great to debug things.
  • If you are facing problems with OPML import, export your feeds and compare the resulting XML with your OPML. This may give you a good insight.
  • Try and work with a single feed first. If you can import that successfully, go with the rest.
  • Sometimes your luck plays stronger!

At the end of it, I am a happy man!