Wednesday, May 12, 2010

Rich

This is not a tutorial, but I wanted to share this cool site with you anyways.
globalrichlist.com

Tells you how rich you are.

I'm loaded.
It's official.
I'm the 798,928,823 richest person on earth!



How rich are you? >>

Tuesday, April 6, 2010

Earthquake Notifications!

Does it seems like earthquakes have been happening more often? I mean Haiti 7.0, Chile 8.8, Baja CA 7.2, Sumatra 7.7, all of these YTD! And these earthquakes are causing lots of damage to the places they shake. Not long ago I subscribed to the US Geological Survey's Earthquake Notification System (ENS). There are a lot of earthquakes that happen around the world on a daily basis. Most are below 3.0 magnitude, however so you most likely will not want to be notified about all of them.

For this tutorial let's setup a notification to be sent to our email and cell when a 6.0 or higher quake rattles the earth somewhere in the world.

1. Register with the USGS ENS by following the link below. You should just need to enter a valid email and create a username and password for your account.

https://sslearthquake.usgs.gov/ens/register

2. Check your email and click the link that was sent in order to confirm your email address is valid. (In Hotmail I have to check my 'Junk' folder)

3. Upon following the link in the email you should be taken to the ENS homepage. It should have a map of the world with several tabs at the top and buttons on the right side.

By default you should be set up to receive earthquake notifications in the world filtering out any that are lower magnitude than 6.0. Also there should be notifications set up to send you an email for any earthquakes in the US higher than mag. 6.0.

4. To change the areas for which you would like to receive notifications click a button under 'Add New Region.'


Then simply follow directions to select or draw which region you want. Remember to give your region a name and click save.


5. If you would like to receive notifications to your cellphone you can have the system send you an email to your phone that simulates a text message.

http://lifehacker.com/software/cell-phones/send-sms-from-email-127033.php

Just take your number followed by '@' and your carrier's given domain name for sending texts to phones through email (pretty slick if you ask me) as described in the above link. Put this number in the pop up form that appears upon hitting the 'Add another email' link as in the photo above.


Make sure to select the option 'Pager/Cell Phone' next to 'Message Format.' Upon hitting 'Register Address' you will get a text with a confirmation number. Close the above pop up. Click the 'My Email Addresses' tab on your ENS homepage, and it should have a yellow box saying you have unconfirmed email addresses. Enter the confirmation code here that you got in the text and hit confirm.

The system is pretty strait forward and easy to figure out, so have fun setting it up.  By the way, the system recently got a major overhaul, like, within the last month (April 2010). When I first set mine up it was a lot different.  It has definitely changed for the better.  Also I've found that the notifications are sent out around 30 minutes after the event. I believe this is to filter out any false alarms because the system is not perfect yet.

Hopefully none of you will be having earthquakes hit your area anytime soon. Take care now.

Friday, March 26, 2010

Simple PHP Day Countdown

My fiancée was recently looking at an online countdown until the day we get married. 71 days left as of today! Anyways, it was taking a long time. So I says, "I can do that!" So I made a simple countdown using PHP.

Note: This is for those who already know about either setting up PHP on their own computer or have a server to which they can upload the following code. Check out w3schools for more info on PHP. http://w3schools.com/php/

The basic concept is to find a way to subtract two dates giving you a 'countdown.' This can be done plenty of ways I'm sure, but the easiest for me was to turn both dates into what's called a Unix timestamp. A Unix timestamp is the number of seconds since January 1, 1970.

1. First lets turn our destination date (the date we want to countdown to) into a Unix timestamp by using a PHP function called strtotime().

strtotime("6/5/2010")

This will turn June 5th, 2010 into this: 1275714000.

2. Get the current Unix timestamp for this exact moment in time. This is made easy through the use of the function time()

time()

This exactly as it is above will return the Unix timestamp for that precise moment.

3. Now we can subtract the two amounts of seconds to get the number of seconds between now and our destination date.

strtotime("6/5/2010") - time()

4. In order to get the number of days from that amount of seconds we simply convert those seconds to days by division as follows. Lets say our seconds returned from the above calculation equals 172800. Take that number and divide it by the number of seconds that are in a day, 86400.
I can never remember how many seconds are in a day (I said I was a nerd...but come on). So a simple solution is to divide the seconds that are returned by this: (60 x 60 x 24). 60 seconds multiplied by 60 equals the seconds that are in an hour. Times that by 24 and that gives you the seconds in a day. The two statements below work the same.

$days = (strtotime("6/5/2010") - time())/(60*60*24);
$days = (strtotime("6/5/2010") - time())/86400;

5. Next will be to round this number because it will be returned as a decimal such as 1.78483. So we use the ceil() function to round up.

$days = ceil((strtotime("6/5/2010") - time())/(60*60*24));

6. Then simply display the variable we just filled.

echo $days;

All together now.

$days = ceil((strtotime("6/5/2010") - time())/(60*60*24));
$s='';
if ($days!=1) {
     $s='s';
}
echo $days. " day$s till we get married!";



Note the $s variable is to determine if I should make the word 'day' plural or singular upon writing it to the page. It basically checks to see if the $days variable equals 1 or not. If it does the word 'day' will be written. If not, 'days' will be written. Pretty simple.

Well hope this helps you countdown the days or basically whatever you want to count, until the special date.

Thursday, March 18, 2010

Hiding Facebook Friends

So I recently got a Facebook email from a radio personality from St. Louis asking about an application (Pending Friend Requests) I had written on Facebook.  She asked if the app allowed users to see which friends you add or delete. It does not. It will not distinguish between an Ignore and letting the request sit and wait (pending). Facebook already lets you view pending friends, but it is in a much more convoluted way. The app simply lets you view them in a nice convenient way.

Anyways, this radio personality said a friend was upset with her because she had added other friends but not them. The only way a 'non-friend' can see your friends is by viewing your profile publicly. To insure that 'non-friends' cannot view your friend list follow the steps below.

Note: The Facebook layout changes with every gust of wind, however, the following directions are guaranteed to work with the current Facebook as of the publishing of this post.

1: Once in Facebook click the 'Profile' button at the top of the page.


2. Scroll down to your friend list on the left side of the page and click the pencil icon.




3. Uncheck the box that says, "Show Friend List to everyone."



4. Done! Now you don't have to worry about other people being nosy and or offended by you ignoring them. :)

Oh the good ol' days when a real friendship started with a handshake or an innocent flirt.  Sometimes I wonder if Facebook really messes up what could be great real friendships.

Wednesday, March 17, 2010

Intro

Well, hello there internet traveler. I assume you come looking for answers. Take a look around. I might have what you are looking for. I add a few new tutorials every week. Don't believe what the date on the latest post says.

I am a nerd. You are safe here. I know what its like to be working on a project and either not be able to finish or its taking way too long to finish. So I pledge to write a tutorial for many of the random things I do. I don't know how helpful that will actually be to all of you, but for the maybe half a percent of the world population that shares the same interests as me, I present to you a gold mine.

I wish to have tutorials on things ranging from making a website to putting in a car stereo system to building a custom computer (mac or pc). Basically things that I would need help on. Trust me this is going to be random and sometimes very specific. For example, last week I put Windows 7 on an Asus Eee PC using a jump drive. Got a project like that? Everybody needs a nerd.

Oh yeah, feel free to leave comments suggesting new things I should do tutorials on. It will only help. Thanks and enjoy!