Sublime Text 2 – Highlight All Instances of Words

I love the feature of the e Text Editor to highlight all instances of the word that your cursor is currently on. This is a difficult feature to describe, but see in the screen capture to the right that I have my cursor on one instance of “sel” and all other instances of the word are highlighted in yellow.

I recently heard about the new version of Sublime Text 2, a text editor that promises to become “a text editor you’ll fall in love with.” It does not, however, have this feature that I have come to depend on in e. Luckily, as they are building this new version of Sublime Text, the development team is using User Echo to allow feature requests to be generated by the community. I found this feature in a request – Upon selecting a word, highlight all occurrences.

In this post, a user had posted a plugin to take care of this feature, but in this plugin you had to select the word to get it to be highlighted. My request was for any word that you have your cursor on to be highlighted across the entire document. I requested this change, and less than 4 hours later, the plugin author had responded with an update to his plugin.

I have copied the plugin below, but the latest version can always be found at GitHub. Thanks a lot to adzenith for his plugin and service to the community.

word_highlight.py – with highlight when selection is empty

JavaScript Accordion Image Slider

Sometimes instead of the standard image fader as the center of your website you need an accordion type image slider. I recently was in this bind, and found a great solution – the Horizontal JavaScript Accordion by ScripTiny. It’s a great little CSS-JS combination that will allow you to put an accordion image slider anywhere on your website with ease.

How to Install

To use this script, first download the zip file from the ScripTiny website. The zip file contains the two required files: slidemenu.js and slidemenu.css. The other files make up the example page.

Step 1
Upload those two files to your webserver. Next, include the following lines between the <head> … </head> tags in your page:
<link rel="stylesheet" type="text/css" href="FULL/PATH/TO/slidemenu.css" />
<script type="text/javascript" src="FULL/PATH/TO/slidemenu.js"></script>

Step 2
Next you have to add this tag to the body tag of the page:
onload="slideMenu.build('sm',200,10,10,1)"
Customize the parameters to meet your needs:

  1. The first parameter is the id of the unordered list you would like to bind the accordion to (default sm is used throughout this tutorial)
  2. The second parameter is the width you would like the accordion selection to expand to. If you change this, make sure you change the width of “.sm” in the slidemenu.css file (line 2).
  3. The third parameter is the timeout variable to control how quickly the sliding function is called.
  4. The fourth parameter is the speed of the accordion with 1 being the fastest. 20 is average, and 40 is very slow.
  5. The fifth parameter optional and is the integer that corresponds to the section you would like to be expanded when the accordion is loaded. If you want the fourth slide to be expanded when the page is loaded, this should be set to 4, etc.

Step 3
Finally, in the body of your HTML document, add the actual content:


<ul id="sm" class="sm">
<li><img src="IMAGE/1.png" alt="" /></li>
<li><img src="IMAGE/1.png" alt="" /></li>
<li><img src="IMAGE/1.png" alt="" /></li>
<li><img src="IMAGE/1.png" alt="" /></li>
</ul>

Now check out the page you created and marvel in the accordion awesomeness. It even works on many Smartphones (like the iPhone!)

Update: Another good option is ImageMenu by Samuel Birch – a MooTools plugin.

Is IE7 the new IE6

As a web software engineer, I am often creating websites that need to work and look correct on a variety of browsers. Of all the browsers out there to code for, Internet Explorer is by far the worst. There are entire websites devoted to this fact (http://ihateinternetexplorer.com). YouTube does not even work on IE6. Although not as bad as IE6, IE7 is now the worst browser in terms of standards compliance and display issues. As the new “most despised” browser, and with IE6 practically dead with only 2.5% of global pageviews, IE7 is the new IE6.

I recently solved a particularly hairy IE7 bug, and created this image to commemorate the occasion. Feel free to use it.

Tom Merritt – UIUC IDs

Tom Merritt is a tech reporter and host on TWiT – This Week in Tech – the podcast network of Leo Laporte. Tom is also an alumnus of the University of Illinois at Urbana-Champaign, my alma mater. He recently was showing some old identification cards on the live TWiT stream, and one of them was of his old I-Card, the U of I college ID. A far cry from today’s version, seen below.


Tom Merritt’s I-Card, circa 1980s?


My I-Card, 2006


Current version of the I-Card, 2010

Where is K’naan?

I recently read a great article in Fast Company magazine – Portrait of the Rapper as a Young Marketer: How K’naan Delivered on Coca-Cola’s $300 Million Bet. It’s about K’naan, a Somalian musician, his rise to fame when he booked an advertising deal with Coke for the World Cup 2010, and how he’s still trying to make it in the music business.

One interesting fact about K’naan’s deal with Coke is that he created a special cut of his song “Wavin’ Flag” for the campaign. It’s called the “Celebration Mix.” The two versions are here:


Some would call this act of creating two versions of your song “selling out” – but K’naan does not think so.

“I knew Coke wasn’t going to put its money behind ‘So many wars, settling scores/ Bringing us promises/ leaving us poor.’ And writing a whole new thing would have been a jingle. Emmanuel was too sensitive to ask me to rewrite ‘Wavin’ Flag.’ So I offered to do it.” … “It might sound arrogant or stupid,” says K’naan, “but I feel so outrageously authentic at what I do that the question of selling out or not selling out doesn’t even enter my head. I think people who worry about this must already be worried about their true credibility. I’m just interested in, How do we get my message out?” (Fast Company)

Future

Another interesting part of the article is about where K’naan is now in his career. He’s not in a place where you would expect a musician who has been heard so prevalently to be. He’s tired. He’s depressed. He’s divorced. He’s playing at small venues. I highlighted some parts of the actual article and attached it.

What does it take these days for a new music artist to get big? It seems like many of the newer artists are struggling to find an audience. What is the reason for this? An increasingly digital music audience who value singles over artist loyalty? Will K’naan be able to make it big in the coming years?