Nifty stuff is a series of blog post delving into nifty stuff I have made and or discovered. Since I'm kinda shary I share my discoveries, for your benefit I hope..
In this first «nifty stuff» I take a look at 4 (four) quite different nifty things, this time in the world of web-development.
- Coda 2 Web Toolkit plugin. Last month Panic released Coda 2, their all in one window web-development platform/editor. Almost instantly a flurry of plugins and syntax modes appeared for this awesome editor. One of them is "Coda PHP & Web Toolkit", which is what the name implies an extension for Coda 2 which allows you to tidy, minify and lint you HTML, CSS and JavaScript code. It can also do a bunch of crap with PHP, so I guess it would be great for that as well. I use it primarily for linting JavaScript and tidying CSS...and it's awesome!
- jQuery ++. This is an extension to jQuery which adds some cool features like comparison helpers and better event handling. Most of all I like that the animate method will support CSS transitions after adding this library (it's not CSS animations which the doc actually say). This alone makes it worth using this if you are dependent on jQuery.
- Printing and HTML 5 elements. Since there are a lot of old shitty browsers like Internet Explorer 8 or worse out there and these does not support HTML structural elements, we need libraries like Modernizr with HTML5Shiv. This makes it so that the older crap shit browsers don't fall over and flop around like a slimy fish on land when they encounter something groundbreaking like a "section" tag. However, the regular HTML5Shiv does not fix this issue for printing, you need to use HTML5Shiv with printshiv for this...so remember that..okay
- Native query selectors. You have probably used jQuery to select DOM elements right? But did you know that jQuery actually uses a native (built into the browser) method for selecting the element if this method is available? There are two methods called "querySelector" and "querySelectorAll". Like jQuery, these methods take CSS style selector strings and returns either the first or all elements as a NodeList (kinda like an Array). These methods are supported in all modern browsers and even in IE 8 or newer!!! So if you're not supporting below IE 8 (which you shouldn't!) you might not need the overhead of jQuery at all.