Closures are often viewed as an arcane art in the land of JavaScript. Once mastered, they allow you to write some truly amazing JavaScript. This article will get you up to speed on the magic of JavaScript closures. What Is A Closure? One of the key truths of JavaScript is that everything is an object. This, of course, includes functions. A closure is nothing more than a function object with a related scope in which the function’s variables are resolved. Closures get their name because of the way they close over their contents. Consider the following bit of JavaScript: topping = "anchovi"; function pizzaParty(numSlices)...
Read MoreWe’re in need of a kick-ass, talented author to help out on Nettuts+ on a regular basis, a Bieber fan preferably. We’re not sticklers but we’d optimally like to see weekly and bi-weekly submissions from you. Do you have what it takes? This is a paid gig, so read on! What You Need A Ninja grasp of the subject matter: Nettuts+ is one of the biggest, most trusted web development blogs out there and this is built on quality content. You, as our author, will need to possess rock solid comprehension of what you’d like to write about. Writing chops: You must be...
Read MoreI’m frequently asked about how I’m able to create new directory structures and files so quickly in Sublime Text 2. Well the answer is that this functionality is not offered natively; instead, I use a helpful plugin. I’ll demonstrate it in this video. Choose 720p for the clearest video. Closing Thoughts It’s worth mentioning that, toward the end of the video, I assign a custom key-binding: n-n. Please note that this binding assumes that you’re working in Vintage (Vim) mode. To trigger it, you’d exit to command mode – by pressing Esc – and then type n-n. If you’re not a Vintage user,...
Read MoreIt’s a month of new beginnings over at our design and inspiration gallery Creattica. April has seen the site undergo a complete redesign with a whole new streamlined grid-style layout for its over 50 different categories. On top of that, Creattica now has better navigation, a new UI Elements section and a growing Freebies area of now over 700 items. All this and over 14,000 featured works from some 100,000 members. It’s quite the site! But that’s not all, let’s first take a look at some of Creattica’s top UI work – and then stay tuned for some exciting...
Read MoreThere are a number of ways to profile and monitor the performance of PHP code in a development environment, but once it’s been let loose on a production server its extremely difficult to know what’s going on when your app is getting accessed by your users. In March 2009, Facebook released XHProf, a function level profiler that allows you to identify bottlenecks in your application. And it runs on a production server with little overhead. XHProf will provide you with a hierarchical profile of the functions your application calls, allowing you to follow the chain of events that lead...
Read More