Client Login



Blog

Food for thought and inspiring minds

February 08, 2010

How to fix the new Firefox tabbing style (3.6+)

Apparently, Mozilla adopted the way Opera handles tabs when you open links in a new tab. Quite frankly, I do not like it since I’ve been so used to the old style of opening new tabs towards the right, and it can get confusing sometimes.

Thankfully with a quick search, I found out through a Google Groups thread that you’re still able to use the old method without having to downgrade or use an extension. Thanks Larry and Dave!

Here’s how to do it:

Type “about:config” in the url bar and agree to the terms that you won’t break anything.
search for “browser.tabs.insertRelatedAfterCurrent”
double click to set it from “true” to “false”

and you’re all set to go!


January 08, 2010

Quick RSS Feed example

Here’s a quick way to get your site running with it’s own RSS feed. You rarely see a site without one!

<?php
header('Content-type: text/xml'); //change file type to XML
include("the database!");  //get config
?>
<rss version="2.0">
<channel>
 <title>Feed Name</title>
 <description>Feed Descriptiondescription>
 <link>http://yoursite.com</link>
<?php
$result = mysql_query("SELECT * FROM entries ORDER BY id DESC"); //get the information
while($row = mysql_fetch_assoc($result)){ //repeat the info
?>
<item>
 <title><?php echo $row['title']; //echo the title
?></title>
 <description><?php echo $row[short]; //echo the content
?></description>
 <author>SiteName submissions@yoursite.com</author>
 <link>http://yoursite.com/index.php?id=<?php echo $row['id']; //another link to the article
?></link>
 <guid>http://yoursite.com/#<?php echo $row[id];// Quick Link
?></guid>
</item>
<?
} //end the while
?>
</channel>
</rss>

Special thanks for runnerjp who supplied the above code!


December 29, 2009

MAMP Pro error fix for Navicat

I decided to upgrade with MAMP Pro since it made virtual hosts much easier, however it cut my production when Navicat told me that it failed to connect. I made sure it wasn’t a port or login error, and it worked with phpMyAdmin.

Thanks to this thread about the same issue with MAMP conflict with Navicat, it needed a socket to connect.

When you connect with Navicat, you go under the Advanced properties and enter the following in.

/Applications/MAMP/tmp/mysql/mysql.sock

mysql-navicat-mamp-pro-sock


December 27, 2009

Functional usage of jQuery to replace PHP

For the longest time, I’ve been using PHP to alternate rows when displaying data in a grid. I stumbled across this neat little site that adds a bit more to tables (or divs for you savvy css designers)

How to use the zebra striping layout via a tutorial and demo

I’ll never go back to the old methods as this will take some processing off the server.


December 23, 2009

Good read on jQuery vs MooTools

Much like any debate: Kirk vs. Picard, Mario vs. Sonic, Joel Hodgson vs Mike Nelson, there’s one on Javascript framework. I personally use jQuery since it was the easiest to learn and had many plugins that did all the heavy lifting, but you should read a semi-unbiased article about Mootools and jQuery frameworks.

You can read the debate on jQuery vs Moo Tools here.


December 14, 2009

Best mac apps for programmers

I’ve been using Coda for web development. It’s a nice program, but I wonder if there are any other programs that can raise the bar a bit higher. Fortunately, such programs exist to make webdesigners lives easier at a small price.

Web Development

MacRabbit has these two promising looking applications, one that just got released to the public called Espresso. It seems to fall short of Coda without quick preview. However it does have the benefit of including a FTP program inside so I don’t have to use Transmit when updating files.

CSS Design

CSS Design is usually a big headache, especially with cross browsing since they all never play nice *cough*internet explorer*cough*.

While the feature with Coda is nice, but it doesn’t really work for me. With CSS3 and HTML5 coming around the corner, there will be a new set of rules to learn. Not to mention that finding how CSS is working with Safari is not possible since there are no plugins like WebDeveloper for Firefox. CSSEdit is there to help. The X-ray feature alone is worth getting the program. There are also many other features worth taking a look.

Project Management

For getting projects on time, I would normally use iCal to set up dates when things were due. While it’s nice, it can get messy. Just the other day, I found Things. Finally I can get my projects organized. It’s like an extension of iCal.


October 09, 2009

Top Domain Name Searching Tools

So you’ve got a great idea for a site, but you’re facing one of the toughest part of web development, the site name. It can make or break your company. A really easy to remember name will help bring in returning customers.

Traditional domain name searching can be very painful and slow, not to mention heavy lifting since you’re trying desperately to think of different combination of words that will work for you. Luckily there are some really nifty domain name searching tools out there that are completely free to use, helpful with search results, and are fast!

bust-a-name

You have two options for domain searching on this site. One is a keyword suggestion area, where you can enter keywords that are relevant to your site. The more keywords you add, the better chance you have with a combination that is available to use. The other option is to do a quick domain name search, which is standard for many of these domain name searching tools. On the plus side, it gives you the ability to save your search results for a later hunt.

domize

This one is pretty cool. It’s simple to use and as you type, it will search for your domain. So if you’re looking for a shorter name, I would recommend using this domain search tool.

domainit

Need help finding keywords that are related to your domain? This tool will give you suggestions that you might not otherwise think of. It’s not as sleek as the other tools but it does give you results.

nametumbler

This is another good site that combines your domain with keywords and endings. You choose the “theme” of the keywords, such as business lingo, food terms, animals, and so on.

domainsbot

This site gives you the standard suggested sites to register when you type it in. I like them because of their firefox extension, so you don’t have to waste a tab on domain searching.  They also give you the option to register and have your domain results saved.

These sites should help you on your domain name searching. The method of domain name searching might change later, but for now .com, .net, and .org are the strongest forms of domain names out there.


October 02, 2009

jQuery simple comment form

jQuery is such a powerful tool, and mastering it will take only a few months at best. Here’s a very simple form that you can use to test out jQuery’s ajax ability. For best practices, you want to make sure that the form still works when javascript isn’t enabled. Why sacrifice functionality?

Before we begin, you need to download jQuery (current release 1.3), otherwise you’ll get a bunch of errors. Also make sure that you’re making a connection to the javascript file. So often the script won’t work because the browser cannot find the jQuery javascript file on the server.

Now once you upload that javascript file and make sure that it’s there, you’re ready for the form.

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script language="javascript">
function ajax_submit(){
var nameField = $("#name").val();
var emailField = $("#location").val();
var commentField = $('comments').val();

 $.ajax({
 type: "POST",
 url: "submit.php",
 data: "name=" + nameField + "&email=" + emailField + "&comments=" + commentField,
 success: function(msg){
 $('#message').html(msg);
 }
 });

}

$(document).ready(function () { //begin document ready
$('#name').focus();
$('#submitbutton').click(function() { ajax_submit(); return false; });
});
</script>
<form method="POST" action="submit.php">
<div id="message"></div><br />
Name: <input type="text" name="name" id="name"><br>
Email: <input type="text" name="email" id="email"><br>
Comments: <br /><textarea id="comments" name="comments"></textarea><br />
<input type="submit" value="Send email" id="submitbutton">
</form>

Now for the submit.php page, which is simplified for the purpose of getting an answer.

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];

if($name) { //if someone typed in a name
echo "Thanks for using the comment form!";
} else {
echo "I don't know who you are...";
}
?>

You can test out the script demo to see what it will look like. You can add more creative stuff to it, but this will get you started.


August 01, 2009

PHP date essentials

In my projects, I’m always using dates, but to make life easier, I’ve composed a list of the dates I use to help reference by name rather than by the code.

<?php
$today = strtotime('today');
$yesterday = strtotime( '-1 days' );
$beforeyesterday = strtotime('-2 days');
$lastweek = strtotime('-7 days');
$lastmonth = strtotime('-30 days');
$lastyear = strtotime('-365 days');
$showtoday = date('M d');
$showyesterday = date('M d', $yesterday);
$showweek = date('M d', $lastweek);
$showmonth = date('M', $lastmonth);
$showyear = date('Y', $lastyear);
$now = time();
?>

I hope this is helpful for other PHP coders out there.


July 22, 2009

Inside Google Voice

I was surprised to see this little gem in my inbox.

google-voice-invite

read more …


Older Posts »