About Us

Bulletpoint StarImulus® is a technology focused design + interactive agency.

In addition to our client services we also have a few products in the works. Our office is always filled with chatter and this blog is an outlet for our creative energy, rants and ideas.

Podium

StacksStacks ®
A group task management solution that finally makes sense.

Sign Up For A Free Trial »

Featured Project

Category: JavaScript

Jun6

How to set up a sexy jQuery TextMate bundle

Here at Imulus we’re massive fans of jQuery. We use it on a lot of our projects. We’re also fans of TextMate, an awesome text editor produced by the folks at MacroMates. Over the last few years we’ve refined our TextMate bundles (code highlighting and language recognition packages) to work ideally within the Imulus process.

So, during my recent love affair with jQuery I’ve heavily relied on their documentation section to look up specific functions and commands. And while their documentation is awesome, it’s still a slow process. Luckily, an awesome guy named Karl Swedberg has put together a beautiful jQuery bundle for TextMate that has tons of snippets for common jQuery tasks. And, it’s free!

Installation

Head over to GitHub and grab the lastest version of the bundle. When you download it you’ll get a weird filename like this:

kswedberg-jquery-tmbundle-b0622e4f889112c37e03400a6a3e63241ab29c31.zip

Unzip the file and change the folder name (which is the same as above) to:

jquery.tmbundle

Open up TextMate and then double click the jQuery bundle file you’ve just created. Boom! The bundle is installed.

Making it work within HTML documents

By default the jQuery bundle is set to only work within .js files. However, if you’re planning on using it within HTML pages you’ll need to do another few steps of work. First, copy the following code to your clipboard:

{    name = 'source.js.jquery.embedded.html';
            begin = '(?:^\s+)?(<)((?i:script))\b(?![^>]*/>)';
            end = '(?<=</(script|SCRIPT))(>)(?:\s*\n)?';
            beginCaptures = {
                1 = { name = 'punctuation.definition.tag.html'; };
                2 = { name = 'entity.name.tag.script.html'; };
            };
            endCaptures = { 2 = { name = 'punctuation.definition.tag.html'; }; };
            patterns = (
                {    include = '#tag-stuff'; },
                {    begin = '(?<!</(?:script|SCRIPT))(>)';
                    end = '(</)((?i:script))';
                    captures = {
                        1 = { name = 'punctuation.definition.tag.html'; };
                        2 = { name = 'entity.name.tag.script.html'; };
                    };
                    patterns = (
                        {    name = 'comment.line.double-slash.js';
                            match = '(//).*?((?=</script)|$\n?)';
                            captures = { 1 = { name = 'punctuation.definition.comment.js'; }; };
                        },
                        {    name = 'comment.block.js';
                            begin = '/\*';
                            end = '\*/|(?=</script)';
                            captures = { 0 = { name = 'punctuation.definition.comment.js'; }; };
                        },
                        {    include = '#php'; },
                        {    include = 'source.js'; },
                    );
                },
            );
        },

Then open up the TextMate bundle editor and drop down the HTML arrow.

html-selection

You should now see a huge list of snippets, commands, and preferences. Located in this list is an HTML language icon, it looks like this html-icon. Once this is selected you should see a large amount of code to the right. Paste the above code directly in the following position after patterns = (

patterns-paste

That’s it, you’re done. How you can access tons of jQuery snippets and code examples directly inside TextMate.

Jan28

sIFR Lite Flash based type replacement, holy shit wow

sifr-thanksOnce in a while you come across a script that makes your life dramatically easier. Today that script was sIFR Lite.

Over the past few months we’ve been working on a client project that requires us to use a specific typeface for page headings on the website. Rather than doing standard -9999px image replacement techniques, which would have made our intern want to gouge out his eyes with an ice pick, we decided to give the sIFR replacement technique a try. sIFR 2.0 is a technique that came out in mid 2005 and has been used by a limited number of sites. Well, as cool as it is I ran into quite a few problems when first implementing it with our project. And while I got it to work I felt slightly dirty about the implementation. Luckily a couple days later I saw a post on twitter by Matt Crest about a new solution called sIFR Lite.

Today, I finally had the chance to replace the old method with the lite version and I have to say it is exceptionally well done. Dave over at AllCrunchy.com has done a phenomenal job with his implementation of the sIFR technique. Making it lighter, easier to use, easier to install, and easier to manage. In fact, it reduces the amount of work by about 5x and in my tests it seems to render better. Better aliasing and better container size detection. Check out the example I whipped up.

Here’s the javascript code required to call sifr-lite:

window.onload = function () {
	var din = new Font('din.swf', {tags:'h1'});
	din.replace('h1')
}

Two quick notes: First, I do find that without using the window.onload function that in Safari sometimes the text won’t pick up color. This is very minor and easy to fix.. obviously. Second, you will need to use the original sIFR to create the .swf files of your font’s. Simply use the .fla and .as files that come with that script to make your fonts, then call those fonts via sifr.lite.js. For those looking for an all in one option I’ve put it together in a zip file. Please recognize I take no credit for the sIFR script or the Lite implementation of it, I simply thought it would be nice to have an all in one package to make things work.

Update: After further testing it seems that this technique is not yet compatible with Flash Player 10 except in Internet Explorer. Hence, if you’re running Flash 10 you won’t see the replacement technique. I hope this gets fixed soon as a fix is already out for sIFR 2.

Update 2: From our comments Gyo over at (http://www.giordanopiazza.com) has released an updated and fixed up version of sIFR Lite. I plan to start using this again for our projects. Very cool!

Aug18

Tracking File Downloads with Google Analytics

Yes, you can track file downloads with Google Analytics. Although it doesn’t automatically give you that capability by just dropping in the Google Analytics Code, here is a simple method to add that tracking ability. For each file that you want Google Analytics to track, you need to create a “virtual page” using the pageTracker function in each file HREF in your site.

Example:
If you site has a PDF called financial-report.pdf and the link is
<a href="/files/financial-report.pdf">Financial Report</a>
That code will need to be rewritten to read.
<a href="/files/financial-report.pdf" onclick="pageTracker._trackPageview('/files/financial-report.pdf');">Financial Report</a>

This works great for a limited number of files, but for sites which have multiple file downloads. You may want to try Brian Clifton’s JS Script.

Apr3

Table row class calling via a small JS file.

Tables, yikes! A constant problem that we run into here at Imulus is clients that want tables with alternating color rows but don’t understand the concept of editing HTML to add a class of odd or even to them.

So today Ryan took a few minutes and created a tiny javascript that automatically applies an “even” class to every row of a table. Now we can apply our styles via the CSS and the clients don’t have to worry if they generate their own tables via Central 2 (the Imulus CMS). The script relies on Jquery (http://www.jquery.com) and is incredibly easy to set up.

Download the script: Table-Row-Switch.zip

Mar14

Straight Out of Google Labs

Every now and then I drift into the Google Labs to have a look at the current projects underway. This latest round I was intrigued by several cool projects baking in the Google oven.

Google Notebook

http://www.google.com/notebook

Pros: This is my favorite item coming out of the labs. Especially if you install the "My Notebook" toolbar for your browser. This way you can highlight and right click items on a Web page and save them to your notebook. It is sort of a glorified scribble pad of idea, text and links which you can search on later.

Cons: I haven’t found one yet, but let me keep working with it and I’ll be sure to find something it can do better.

Google Music Trends

Visit http://www.google.com/trends/music

Pros: The default listing isn’t that interesting but once you select a Genres or Country, then the list becomes a bit more interesting.

Cons: It’s just Google Talk participants so the data feeding into this is a bit suspect to say the least.

Google Trends

Visit http://www.google.com/trends

Pros: Presents a visual trend line on various search terms. The regions and cities is a useful subset of data which sometimes shows very distinct differences how users search.

Example: I used "web site, website" to see which term most people search on. Interestingly enough both terms have dropped in search volume from 2004 to 2008 however the news references for the terms has increased in the same time period. Plus, India much prefers the grammatically incorrect "website" whereas the French and Italians lean towards "Web site".

Cons: The news on the right seems a bit odd and out of place. I actually stumbled on two broken links during my short tests.

Google Code Search

Visit http://www.google.com/codesearch

Pros: If you are looking for code examples to steal learn and integrate into your project, this is certainly a good point to start from.

Cons: Just stay away unless your a coder.

Google Mars

Visit http://www.google.com/mars/

Pros: I think I found a real nice piece of real-estate once we find a way to get there.

Cons: For real? Why do we need this? And why does it wrap 4 times when you zoom all the way out? I’m still waiting for Google to drop a Martian into the map as an Easter egg.

Google Information / 411

Dial 1-800-GOOG-411

Pros: Uses voice recognition to locate businesses and then patches you right thru, and yes it’s free. They located "Imulus" in Boulder, Colorado just fine and on the first try. Not bad for a word which is hard to decipher with voice recognition.

Cons: Where is the residential side of this ;)

Transit

Visit http://www.google.com/transit

Pro: Once you find a location which has public transportation the familiar Google Map interface is overlaid by transit locations which highlight when you select a schedule which is close to the time you wish to leave.

Cons: The city availability is pretty limiting, especially in the US where the coverage is scattered and seems to defy logic. For instance why would they have coverage for Grand Junction, Colorado rather then Denver, Boulder or even Colorado Springs? Sorry, no New York or Chicago either.