Skip to content


PHP Video Tutorial - Getting Started - Installing XAMPP

I’ve decided to give this a try and make a video on Installing & Running XAMPP, the easy to instal web stack for developing websites on your own computer. This video is for beginners who need help walking through the installation of XAMPP.

View Video Tutorial - Installing XAMPP

If you have any questions or comments, feel free to leave them here. If you enjoyed this tutorial and are in need of a web server, check out Layered Tech, a server host that I highly recommend.

This blog is hosted on:


Posted in General. Tagged with , , , .

Local LAMP Developement & User Content

I've come up with a simple solution for handling user uploaded content when trying to work in a local development environment. I've installed XAMPP on my windows machine and at the beginning of every week I take a database snapshot and update my local database. I had a pretty smooth system going with one problem: user uploaded content.

When working with social networking sites, many times they allow for users to upload their own videos, pictures, etc. My current project wasn't different, but I didn't want to download 80GB of user content every week to store on my PC. I wanted a way to point my browser to the live server to get recent images, etc.

My solution was simple: .htaccess file using a 301 redirect. I basically told my local apache server to return a HTTP status of 301 (Moved Permanently) and point the browser to the live content. I created a .htaccess file inside the "uploads" directory and added one line of code:

CODE:
  1. Redirect 301 /uploads http://www.example.com/uploads

I restarted apache and now when I work locally, I can still see all of the user's photos and uploaded content. Works like a champ!

Posted in Programming. Tagged with , , , , .

Ubuntu Desktop Terminal - Su

This is just a quick reference for myself. When I want to "su to root" in Ubuntu's terminal I need to do the follow:

sudo su
[enter password]

Posted in Technology. Tagged with , , .

Jing - Sharing Made Easy

I've found this really cool program, and it is awesome. I think Jing has stumbled upon a great idea. The concept is simple: instead of explaining things, you show things. In a nut shell, I can select any part of my monitor, take a screenshots and make notes on it, or make a video recording, and upload it to the web. I've been able to do this before, but Jing makes it 100% streamlined. It works for Windows and OS X.
Here is how it works. After installing Jing, it places a little icon at the top of your screen. You can move this little "sun" anywhere along your monitor (or any monitor if you have more than one.) I keep mine at the top center where it never interferes with anything else.

If you hover over it, you can make a new capture, look at your history, or change your settings.

If you select the crosshairs, it will give you a selector. You simply select the area of your screen you wish to capture. It will ask you if you want to make a video or take a screenshot. Here is an image of what it looks like when you take a screenshot:

You can add highlights, callout boxes, and notes, all super quick and easy. You can then select to upload the screenshot or video, and it will put the link or embed code in your clipboard, ready to paste. You can use their free Screencast.com to upload their files, or you can save it as a file, or upload it to your own FTP site.

Here is a video example I made. I could embed it on my blog, but the dimensions of the video are just huge. I definitely will be using Jing for my day-to-day use.

Posted in General.

Adeona - Open Source LoJack for Laptops

There is nothing worse than having your laptop or computer stolen. Recently, a close family member had his house robbed, losing his PC and Laptop. The biggest set back wasn't the cost, but the hundreds of important files for work that were lost.

If you're looking for a way to help recover a stolen PC or Laptop, I suggest using Adeona. Here is an except from their front page:

Adeona is the first Open Source system for tracking the location of your lost or stolen laptop that does not rely on a proprietary, central service. This means that you can install Adeona on your laptop and go — there's no need to rely on a single third party. What's more, Adeona addresses a critical privacy goal different from existing commercial offerings. It is privacy-preserving. This means that no one besides the owner (or an agent of the owner's choosing) can use Adeona to track a laptop. Unlike other systems, users of Adeona can rest assured that no one can abuse the system in order to track where they use their laptop.

Adeona is designed to use the Open Source OpenDHT distributed storage service to store location updates sent by a small software client installed on an owner's laptop. The client continually monitors the current location of the laptop, gathering information (such as IP addresses and local network topology) that can be used to identify its current location. The client then uses strong cryptographic mechanisms to not only encrypt the location data, but also ensure that the ciphertexts stored within OpenDHT are anonymous and unlinkable. At the same time, it is easy for an owner to retrieve location information.

I've installed it on my laptop, and I will let you know how I like it.

Posted in General.

It’s Time for Campaignin’ - Elections Video

I couldn't help resist posting this video I found over at John P's blog. The thing I like best is that it equally hammers all people involved.

Posted in General.

CSS - ID vs Class

After hacking apart & cleaning up code for the better part of the day, I've decided to set the record straight about CSS, IDs, and Classes. The question is "when should I use an ID, and when should I use a class?" Is it that big of a deal?

The big issue is that people who just write Cascading Style Sheets usually won't run into problems if they are more lax with their use of IDs. Its the people after who coming in trying to add advanced JavaScript features that will end up becoming very, very frustrated.

Why does it matter? Because an ID and Class have one major difference:

ID is supose to be 100% unique to a single HTML element through the entire HTML document. Class can be shared among many elements.

Example:

HTML:
  1. <!-- This HTML element is using an ID -->
  2. <p id="text">This is using an ID</p>
  3.  
  4. <!-- This HTML element is uing a class -->
  5. <p class="text">This is using a class</p>

What is the big deal? For CSS designers, not a whole lot. In fact, IDs have a higher specificity, so some CSS designers default to using an ID just because it is more convenient. The problem is when your boss say "hey, we need two paragraphs." The developer copies a new paragraph in and to keep the formatting, adds another ID tag. Now we've broke the rule about only having one ID in an HTML document. Sure, it renders fine, but if a JavaScript developer tries to add additional features, they will have to code around these problems.

So when should you use ID and when do you use a class? Here is my rule of thumb:

Unless you are 100% sure that you will never, ever have a duplicate element name on the same page, use a class. When in doubt, use a class. Only use an ID when you're positive it will always be unique.

Examples of when I would use an ID are:

  • Unique parts of page layout: <div id="header"></div><div id="content"></div><div id="footer"></div>
  • Identifying specific items: <div id="post-32"></div><div id="item-123"></div>

If it doesn't fall into those two categories, I usually won't use an ID. Most of the time, I've never had moment where I wished a developer had used a ID instead of a class. But I've had many times where I wish an element used classes intead of ID.

Posted in Web Design. Tagged with , , .

Exactly 9 Years Ago Today: Fannie Mae Eases Credit To Aid Mortgage Lending

I read this article on John P.'s blog "One Mans Blog" today and I thought I would pass it along. Here is an except:

In a move that could help increase home ownership rates among minorities and low-income consumers, the Fannie Mae Corporation is easing the credit requirements on loans that it will purchase from banks and other lenders.

The action, which will begin as a pilot program involving 24 banks in 15 markets — including the New York metropolitan region — will encourage those banks to extend home mortgages to individuals whose credit is generally not good enough to qualify for conventional loans. Fannie Mae officials say they hope to make it a nationwide program by next spring.

Fannie Mae, the nation’s biggest underwriter of home mortgages, has been under increasing pressure from the Clinton Administration to expand mortgage loans among low and moderate income people and felt pressure from stock holders to maintain its phenomenal growth in profits.

I've been debating whether or not to post an email from a colleague of mine who in his spare time researches political issues and sends emails out to friends on his findings. I didn't want to turn my blog into a "political" blog since I mostly focus on technology and web development. However, with all the media pointing their fingers at Bush, I thought I might as well share it:

Playing the Blame Game - Who's to blame for our economic crisis?

“The Bush Administration today recommended the most significant regulatory overhaul in the housing finance industry since the savings and loan crisis a decade ago.” – The New York Times, 9/11/2003

Did it pass?  Is Bush responsible for our present economic crisis? What was McCain saying at the time? What about Obama? Read on.

According to the Investor’s Business Daily, warning signs of this collapse were everywhere. It wasn’t a matter of “if”, but a matter of “when.” So who’s to blame for this situation? The Bush administration? Congress? Wall Street? All of the above? Continued...

Posted in General. Tagged with , .

Carrington Theme & Hashcash Plug-in Solution

I've been a huge Hashcash fan since using WordPress. In a nutshell, it requires a browser to process some javascript to generate a number to verify that the browser in-fact read the page. This helps prevent bots from submitting spam comments. The idea is that if a spam bot was required to process the javascript to make a "hash", it would slow down posting comments by 20 times, if not more. Spammers make money off volumn, so they would lose "cash" slowing down their spamming. Hence the name: Hashcash.

Carrington is my current theme for WordPress. It has some ajax features for loading content and comments on the home and archive pages. It makes it a lot easier to post comments, and works really well. The problem is that Hashcash wouldn't execute the JavaScript after loading comments via ajax. I had to make changes in two places to make it work.

First change is in /wp-content/themes/carrington/js/carrington.js on line 21:

setTimeout("jQuery('#wphc_value').each(function(){ jQuery(this).val(wphc()); });", 2000);

This goes inbetween the lines of:

jQuery('#post-comments-' + post_id + '-target').html(cfct.loading()).load(CFCT_URL + '/index.php?cfct_action=post_comments&id=' + post_id);

...

return false;

Second change goes in the Hashcash plugin file on live 340. Change this line:

if((is_single() || is_page()))

To this:

//if((is_single() || is_page()))

That will put the hashcash javascript code in the header for every page.

Hopefully this will help anyone who is trying to get Carrington and Hashcash to work.

Posted in General.

WordPress Carrington Theme - I’m Impessed

I just read over at Matt Mullenweg's blog about the annoucement of the Carrington Theme for WordPress. For those who don't know, WordPress is a PHP/MySQL based blogging system and is the one I use for my blog. I've installed the Carrigton Theme and I really like it. Over the next few weeks I'll be checking it out and playing around with it. I'll keep everyone posted!

Update: I guess some people are having an issue downloading the Carrington theme, so I've uploaded it to download from my site. Hopefully it won't kill my bandwidth, but I should be good.

Downloads: Carringon Theme for WordPress

Posted in Technology, Web Design. Tagged with , , , .