Category: Shared Ideas

Animate WordPress wp_nav_menu

  |   By  |  No comments

I spent the last couple of days working on a solution to animating WordPress’ wp_nav_menu output. I thought I would take a moment to jot it down and share it with anyone else looking to do the same.

Once I got it started I couldn’t give in, and came up with pretty simple solution. The document ready should work in most situations. In some cases you can remove it.  You may need to alter the selector, but I tried it on both TwentyEleven and TwentyTen.

jQuery(document).ready(function($){
$(“#access .menu li”).mouseleave(function() {
$(this).children(“ul”).stop(true, true).css(‘display’,’block’).fadeOut(100);
});
$(“#access .menu li”).mouseenter(function() {
$(this).children(“ul”).stop(true, true).css(‘display’,’none’).fadeIn(400);
});
});

Enjoy!

Using MySQL FULLTEXT Index for Short Words

  |   By  |  No comments

The other day I was presented with an issue. The issue had to do with search results returned from a MySQL MATCH (field) AGAINST (‘text’) query. The MATCH query requires the MySQL field to be a FULLTEXT index.  The MATCH query can then return a weighted score, making it effective for this type of search ranking query.

The issue arose when searches contained short words, for example ‘key.’ MySQL’s FULLTEXT index has a setting for how long a word must be for inclusion into a FULLTEXT index. The setting is ft_min_word_len. MySQL’s default for ft_min_word_len is 4, so ‘key’ wouldn’t be included in the index. This led to searches  where ‘key’ would not return any results, but searches for ‘keyword’ would. Also, searches for ‘key lock’ would return results for ‘lock’, but not ‘key.’

Here is how one can change the value of ft_min_word_len. Open your my.cnf file or my.ini file on Windows.  In the file locate the [mysqld] text. Below [mysqld] copy and paste the following MySQL option:

# Note that you need to rebuild your FULLTEXT index, after you have
# modified this value.
ft_min_word_len=3

If you are having problems saving your my.ini file right click on the text editor launcher and launch the editor as and Admin. Restart the MySQL server and run the following query to retrieve the setting:

“show variables like ‘ft_min%'”

Your ft_min_word_len should now be 3, and you need to reindex your table in order to search for words equal to ft_min_word_len.

We thought we’d share this in the hopes that it helps someone else out.

Textastic Review – Our thoughts on this IPad IDE

   |   By  |  No comments

I needed to dump my laptop for a few days, so I figured I’d give an IPad IDE a shot. You never know when small changes need to happen, and again, I don’t want to lug my laptop. I am already carrying a surfboard.

The solution was to download Textastic. Setup was intuitive, and I had no problem editing PHP files.

  1. Setup your connection to the server using the desired protocol.
  2. Download files to your local files, or create a directory.
  3. The file is now on the Ipad, and you click on it to edit.
  4. Upload the file back to the server.

The code highlighting works well and my back will thank me!

The code editor includes a custom keyboard layout (see image below).

I would recommend Textastic to any web  developers who needs to edit files on the go.

Simple Explanation of Twitter, QR Codes and URL Shortening

   |   By  |  No comments

Simple Explanation of Twitter

An example Twitter sent to an account name TwitterAccount would look like:
@TwitterAccount Can’t wait to attend. Are there rooms still available? #eventname

The @TwitterAccount would direct it to the TwitterAccount account. #eventname is considered a hash tag and Twitter explains here. The #eventname would let others who search for #eventname find the tweet, but one does not have to always send to someone. So, another Tweet might just use the hash tag:

I’m at #eventname Anyone know a of a good restaurant close to the Event?

or another might look like:

Stop by booth 100 and register to win a prize. Drawing at 4 o’clock #eventname

Regarding the QR codes and url shorteners (sp.), bit.ly or goo.gl, etc… Here we’ll use Bit.ly

They take a url and shorten it, making it easier to enter and or tweet. URL shortening started because Twitter only allowed limited characters. For example, http://www.amplitudedesign.com/web-development/online-marketingcommunications/ when shortened becomes http://bit.ly/nYuFNL. Bit.ly also tracks how many times a bit.ly url is clicked on. Bit.ly can also generate a QR code for every url, which can be displayed by adding .qr to the end of any bit.ly shortened url.

Bit.ly version
http://bit.ly/plUArC

QR Code Version:
http://bit.ly/plUArC.qr

QR Codes are explained on Wikipedia.