I came across the situation the other day where I needed to trim a string. However I didn’t need to trim white space characters, I needed to trim some dollar (
$) sign characters. So I looked up the
$.trim() function on the jQuery docs page and was a bit surprised that they didn’t offer any arguments to pass here for the character to trim. So like I always do in these situations I decided to roll my own little trim function. The funciton allows any character to be passed in and by default uses white space characters if no character is set. Read Full Article
After finally catching up with a bunch of things on the blog we finally had a chance to work on the extensions page and got it up and running. There aren’t too many extensions there yet but we will be adding more over the upcoming weeks as we have quite a large list of extensions to add. You can find out more info about the project on the wExtensions Project Page.
Today I came across an error while I was linting my Intelligent RGB / HEX Converter Plugin code about requiring a
radix value for
parseInt(). After a quick look up on Google I could see that excluding this parameter could lead to some rather nasty bugs in your code. The
radix parameter is meant to specify the number system to use when parsing the value passed into
parseInt(). So if we pass in a value of 16 then the number system used would be hexadecimal and a value of 8 would be octal.
The reason why this value is important is because in older web browsers like ie7 and ie8 any value with a leading zero automatically gets parsed as an octal value. So if you happened to pass in a string of
012 this would actually get parsed as the octal value 10. Read Full Article
It’s not very often I need an rgb / hex converter in my apps or to convert a color code quickly, but when I do I find there are never any good tools around to do it quickly. In fact typing in either “rgb to hex converter” or “hex to rgb converter” into Google yields results for sites that have really crappy converters that make you type in each
I have never really gotten into using Grunt, but once I got it going I found out how great it is at automating so many tasks like linting, testing and minifying my files. I actually came across it because I was trying to update one of my projects that had Grunt setup by someone else and so I tried to get it working locally. This led me to a lot of head scratching and confusion as apparently since version 0.4 of Grunt a few things had changed, however once I got everything working it was actually quite simple.
I was not able to find a simple concise guide on setting up Grunt as most of the information was quite scattered so I decided to write this little top to bottom guide. Grunt is actually a great tool and very easy to use. It will also save you lots of time fixing bugs and trying to manually do things like linting or minifying. I hope this guide will encourage you to setup Grunt for your project, so without further adieu. Read Full Article
This is an awesome little plugin that I just came across recently that creates a flip animation on virtually any element on your screen. It’s a very small file size and very easy to use. Most of the code is CSS3 however, so you will need a browser that supports the features for the flipping. I’ve seen plugins like this before, but usually it’s only on
div elements which have to be setup a certain way. This one is pretty slick though and allows you to add some nice eye candy to your apps. Read Full Article
This is a nice little library I wrote for myself as I found I was quite frequently parsing a url in my projects. I was constantly building little custom functions but decided to finally build out a nice simple and lightweight library to help parse url’s with. It comes in at only ~1.6 Kb minified and ~0.6Kb gzipped. It provides pretty much all the basic pieces you will need. Check out the examples below or go to the demo page to play with it on your own. Read Full Article
Originally when I had written it I used what made the most sense to me at the time, basically you set your frame rate (30fps), divide that by 1000 milliseconds for one second and you get your interval between game loops, approximately 33.33 milliseconds. Read Full Article
for loop and a
for in loop as I have received a lot of great feedback from the community. Read Full Article