Outrageous Password Requirements

June 15, 2011 – 7:34 pm

I was recently trying to sign up for an account on the website of one of my favorite podcast/radio shows, This American Life. As I was doing so, I used one of my “low security” passwords in the registration form. I decided to use one of my low security passwords because:

  • The site is not secured with HTTPS, so the password will travel across the internet unencrypted anyway, and
  • None of my personal information, other than the podcasts that I’ve already listened to, will be associated with this account – no credit card numbers, social security numbers, or even telephone number!

When I tried to click “Register” though, I got an error. Apparently, in addition to the numeral and random characters that are in my password, I have to also have both upper and lowercase letters, and also a symbol! Why are they enforcing these outrageous password requirements that, to be frank, many far-more-important internet commerce websites do not even enforce. This is a counterproductive practice that will require me to write down my password, which at the end of the day is less secure than the password that I tried to input in the first place!

This American Life, please fix your website.

Custom Caption on WP-Nivo-Slider

May 23, 2011 – 8:44 am

I was recently working on a project in WordPress, and had to get the WP-nivo-slider plugin to show text other than the picture title. I personally feel that this should be the default behavior of this plugin, so I thought I’d post my solution to the problem to help others in the future.

In the wp-content/plugins/wp-nivo slider folder there is the main plugin file, wp-nivo-slider.php. Open that up, and around line 214 you’ll see this code:
<?php query_posts( 'cat='.$category.'&posts_per_page=$n_slices' );
if( have_posts() ) : while( have_posts() ) : the_post(); ?>
<?php if(has_post_thumbnail()) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<?php endif ?>
<?php endwhile; endif;?>

Because Nivo Slider shows the contents of the image ‘title’ attribute as the caption, we must change the code to send the custom caption to the image title attribute. To do this, we must send an array of attribute/value pairs to the_post_thumbnail.

Simply add a line of code to build this array. This example will send the post title as the caption:
$attr = array('title' => '<h2>' . get_the_title($post->ID) . '</h2>');

Then send that array to the_post_thumbnail:
the_post_thumbnail( 'large',$attr);

After changing that code, you should now be getting the post title as the caption. You can also access other post elements like get_the_excerpt for the post excerpt.

Living in the Cloud

April 26, 2011 – 3:26 pm

I have come to realize that more and more of my data and computing is done in the cloud. I use Dropbox everyday, have my music in the Amazon Cloud service, and use Google Docs, Calendar, Mail, and Contacts. My tasks are in Remember the Milk. My reading list is in Google Reader and Instapaper. My financial records are available online through online banks, Mint, and Google Finance. My friends’ birthdays are stored in Facebook. One thing missing are my health records. Google has Google Health, but I do not have an easy way to pull in all of my past medical records. Mostly this is because the records are simply not in digital form. I hope someday my medical records will be as accessible as much of my other data in the cloud.

Sublime Text 2 – Highlight All Instances of Words

March 28, 2011 – 4:15 pm

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

March 9, 2011 – 7:00 am

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.