MGFX in the MooTools Forge

Posted by Sean on Dec 15, 2009 under

Last week saw the release of the MooTools Forge. And that's fantastic news for the MooTools community. If there was ever one thing MooTools lacked compared to jQuery, it was an easy way to find other MooTools code.

Closures Break my For's

Posted by Sean on Dec 10, 2009 under

I love closures. They are an excellent tool any Javascript programmer should have in his tool set. They let you do fantastic things, and are the way things like the Module Pattern are possible. But they can also be tricky. I'll show you a couple ways they've managed to fool me, so that you can be aware of them when you use them in your programs.

In a recent pet project, I'm exploring Django. As I'm used to in our PHP framework, I like to extend Models with methods that a model should keep contained, and then I can call multiple times elsewhere in the Controller View in Django (don't start me on the stupidity of the naming scheme). In PHP, it's a bit more straight forward: You can simply write some new functions inside the class. In Django, it was a little more complicated. I explored several different parts that all affect writing methods that should be contained in the Model area of the application.

Why Must LAMP Setup Suck?

Posted by Sean on Nov 17, 2009 under

 

LAMP is common lingo for web developers. It's an incredibly popular software stack to run dynamic websites. Many hosting companies include the stack for you, already configured and ready to go. But before we get there? That wonderful point where we trust our code to the production server, and then watch something blow up beautifully in a fire-y mess of status codes, fatal errors, and SQLStates. We developers like to test thing before then.

So I'm left wondering, why does setting up a testing environment suck so hard?

 

My Mental Break Tool

Posted by Sean on Nov 12, 2009 under

Sitting in front of a computer all day long can get boring. Sure, I love what I do. But after staring at text for a while, you have to break it up! And many developers have toys on their desk for just this reason. Mine's a Rubik's Cube.

MGFX.Tabs 1.1 on Github

Posted by Sean on Nov 10, 2009 under

 

Quite a while ago, I released a simple-to-use MooTools tabs class, and it continues to be one of the most frequented posts on the site. With so many people obviously desiring a MooTools tabs plugin, I've added a few new features to the plugin, as well as moved it to Github for inclusion in the future MooTools Forge.

Pluggable MooTools Tabs Revised

 

Select Tags in IE: innerHTML

Posted by Sean on Oct 29, 2009 under

I just wanted to document this rather frustrating bug here, so I can look it up later, and hopefully help anyone else who is running into something similar. This bug involves select tags, specifically setting their innerHTML property.

I had a list of options to give to the user, and a select box would work perfectly. Since DOM methods have burned me in the past, I felt innerHTML was the safer route. It appears, that they both have safety curves like a sine and cosine graph.

Graph of Safety regarding DOM Methods vs innerHTML

Geocoding Addresses with Google

Posted by Sean on Oct 14, 2009 under

We built a Store Locator for our Content Management System, and needed to calculate what stores were close by. That's simple enough in PostgreSQL, which a Point unit type, and simple trigonometry. However, in the Admin area, where you can add new stores, I needed to accept an address in its normal format, and convert that in to longitude and latitude points to be stored. Google's Geocoding API helps us do that.

Fade and Destroy Elements

Posted by Sean on Sep 30, 2009 under

One of my favorite methods that I use constantly in various interfaces combines fading and removing of an element. It could be a table row, or list item, or a div, but often times when I wanted to remove something, I'd like it to remove with a fade. And not always wanting to write to listen for the complete event and then remove the element. So I'll show the original I use in Prototype, and then a port to MooTools.

Exploring Javascript Date Math

Posted by Sean on Sep 22, 2009 under

 

Dates are a peculiar type of data that we have to work with. In some sense, they aren't a number, but instead are a combination of month, day, and year. But at the same time, in most programming languages, they are fundamentally a number: the number of seconds since the Unix epoch.

In our heads, it's quite easy to do Date math. Moving forward a week requires just adding 7 days. How would you do that with a Javascript Date? Programming languages usually try to make working with Dates as logical as it is to do in our heads. So I a little surprised at an irregularity in using Dates in my math.

 

Search

Categories

Treats

  • No RSS feed found.
See all »