If you love the show Arrested Development, like I do, you should consider donating to this documentary like I did.
I’ve made a huge mistake…
The Arrested Development Documentary Project by Jeff & Neil — Kickstarter.
If you love the show Arrested Development, like I do, you should consider donating to this documentary like I did.
I’ve made a huge mistake…
The Arrested Development Documentary Project by Jeff & Neil — Kickstarter.
TL;DR Introducing jSimpleFader, a jQuery plugin to simply fade between images.
UPDATE You can now visit the jSimpleFader Github Page for a live demo, since I know you’re lazy.
UPDATE Added a new option: animationStyle. Right now, the values are fade or crossfade.
UPDATE Added a new option: links. Set this to an array of hyperlinks you want to wrap around your images.
It’s something I’d done a hundred times before. You have a folder of images, numbered in sequence, that you want to fade and rotate through on your webpage. It’s a simple rotator (although, strictly speaking, nothing rotates) that I’ve copy and pasted from project to project with tweaks here and there. So when our designer asked if I knew of any good jQuery plugins that did that, I decided I should just make one myself. Introducing: jSimpleFader.
jSimpleFader is a jQuery plugin to simply fade between images. All it really needs is the total number of images you have, and it rotates through them. The code is straightforward. Just call $('#fader1').simplefader( 10 ); That’s it.
The plugin tries to do a lot of figuring out for you. Your images don’t need any particular naming convention; they just need a number in them. You don’t even need any particular HTML structure; there just needs to be an <img> somewhere. The script has a simple limitation: your images should start numbering at 1, although the first image doesn’t have to be the one on your webpage.
After the number of images, you can pass in an object of options. Here are the options you can set:
Like all jQuery plugins, you can have multiple faders on one page, with their own options, and everything should work fine.
Check out the project on Github, and feel free to participate.
TL;DR Variables in LESS get overwritten, but mixins get combined. To overwrite a mixin, you’ll have to use CSS techniques or guard expressions.
LESS is a dynamic stylesheet language which adds a lot of features to CSS that are common to most programming languages. There’s a lot LESS can do, including adding variables, mixins, and math. Yes, math. You then compile your LESS files into the CSS that our browsers know and love. Whether you hate CSS or love it (like I do), LESS is awesome.
I’ve only started using LESS, and I was curious how it handles variables and mixins that have the same name. In a lot of programming languages, re-declaring a variable or function has the effect of overwriting the original. In CSS, the rules are cascaded, newer ones having precedence over older ones, depending on specificity. How does it work in LESS?
Variables get overwritten. If you first write @value: #000; and later write @value: #999; the value of @value when your CSS is compiled will be #999. This is true for @value everywhere, including previously included files. (Of course, follows the rules of scoping in LESS apply.)
Mixins, including parametric mixins with the same signature, get combined. Literally identical declarations will not be duplicated, but all other rules, even for the same property, just get concatenated together in one large block. Rules are listed in the order that the mixins are declared. The exception is identical rules, which are placed at their last declaration.
This behavior is probably deliberate, since it falls in line with CSS’s cascading nature. It appears that if you want to overwrite a mixin, you either have to redefine those properties the same way you would in pure CSS, or you can write a series of parametric mixins with guard expressions to ensure you get the mixin you want.
Here’s some code to illustrate the behavior I saw. There’s an included_file.less and styles.less which get compiled into the styles.css.
TL;DR Create shortcuts to long-named functions: variables.__ = intermediateFunction;
For a recent project at work, I found that a function I was going to be calling a lot had a very long name. The function was a translation look-up. I pass in a string which represents a language key, and the function returns a value for the target language.
Because our project is heavily translated, it meant I’d be calling the method many times per page. It would going to be a lot of extra typing. The solution we found, to reduce that typing to a minimum, is something I’m calling “shortcut functions”.
Shortcut functions take three parts: the original function, an intermediate function, and the assignment of the shortcut function. With a shortcut function, you can go from writing application.translations.getTranslation( string ) to __( string ).
Don’t give me that look. That’s pretty cool.
shortcutOriginalFunction. Your intermediate function can be an anonymous function, too, which might be less confusing for some people.variables.__ = intermediateFunction;Let’s look at some code. Included is an index.cfm, a translation CFC (which contains our original function), and the Application.cfc that works our magic. This code has only been tested on Adobe ColdFusion 10.

Well, the Miles Rausch family welcomed its newest member this week: Ainsley Ann.
Her stats:
Everyone is doing well. Older brother, Ian, is absolutely obsessed with baby sister, which is a mixed blessing that will eventually get better.
Update: Bryce won. Read his entry.
Have a Yelp account, plan on eating out today, and want to have some fun? Well, you’re uniquely suited to play Friday Fun: Yelp Review!
The rules:
I’ll put up a PollDaddy poll by Monday morning, I’ll leave it open for a couple days, and then announce the winner NEXT FRIDAY! Want an example? Check out Christopher Miles’s review of The Patriot Saloon.
And, have fun!