What have I been reading lately?

Since I became a Christian in 2009, my desire to read has really exploded. I used to loathe reading, but after spending time in God’s Word, I find that I really enjoy reading. Here’s what I’ve consumed recently*:

*Note: These are in order of when I purchased them, not necessarily when I read them.

I’m not going to rate these books individually. I have truly enjoyed every single one of them, and highly recommend all of them. You know yourself better than I do. Take a look at them and see what you think might interest you or be beneficial for you.

Enjoy!

What books have you read that you think would help me?

Share

Issues Synching Amazon Kindle Notes and Highlights to iPhone

The Issue

I don’t mind reading Amazon Kindle books on my iPhone, but sometimes a bigger screen is nice. Thankfully Amazon has Kindle apps for PC, Mac, iOS, Android, etc. The issue I’m having is that my notes and highlights don’t usually sync correctly from Kindle for Mac to Kindle for iOS.

I tried manually synching, but that just seems to push the furthest read page rather than notes and bookmarks. I tried all the combinations you can imagine in terms of the order in which I open the app on the two devices. No success.

The Fix

What I ended up having to do is archive the item on my iPhone and then re-download it to get the correct set of notes and highlights. My guess is that it’s a bug in the iOS app.

Anyone else having this issue and figured out a different work-around?

Share

PHP script to send test emails on a schedule to make sure you are able to receive email

Ever wondered if your email was actually working? I’ve had numerous people over the past few years wonder the same thing. Ideally you would use a consistent, dependable email service provider (think Gmail, Hotmail, Yahoo!, etc.). But sometimes that isn’t an option. If you think you might be receiving email intermittently or not at all, feel free to use this script to send test emails to yourself on a regular basis. If you get the test emails, you know at least someone can get to you.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
 
// Set this to your timezone
date_default_timezone_set('America/New_York');
 
// Start at 8:00 AM (24-hour time)
$startTime = mktime(8, 0, 0);
 
// End at 5:00 PM (24-hour time)
$endTime = mktime(17, 0, 0);
 
 
$currentTime = time();
 
// Do not send the email if it is outside of the allowed hours
if($currentTime < $startTime || $currentTime > $endTime)
{
	print('Not sending an email after hours.');
	die();
}
 
// Get the current day of the week as an index (0=Sunday, 6=Saturday)
$dayOfWeek = date('w');
 
// Do not send the email on weekends
if($dayOfWeek == 0 || $dayOfWeek == 6)
{
	print('Not sending an email on the weekends.');
	die();
}
 
// Info of person to receive the tests
define('TO_EMAIL',		'me@test.com');
define('TO_NAME',		'John Doe');
 
// Info of person sending the tests
define('FROM_EMAIL',	'webmaster@serversendingtests.com');
define('FROM_NAME',	'Email Tester');
 
// Example: 8:00 am on 1 Nov 2010
$subject = 'Test: ' . date('g:i a \o\n j M Y');
 
$message = 'This email was automatically generated. Please send an email to yourusername@youremailprovider.com if you would like to disable these automated tests.';
 
$result = mail(TO_NAME . ' <' . TO_EMAIL . '>', $subject, $message, 'From: ' . FROM_NAME . ' <' . FROM_EMAIL . '>');
var_dump($result);

And finally, setup a cron job that runs on a regular basis (every 15 minutes in this case):

*/15 	* 	* 	* 	* 	wget http://myserver.com/path/to/script.php

I realize that you could do some of the scheduling being done in the PHP script in the cron job definition, but I wanted to have more control over that for future features (think pulling schedules from a database for a multi-user environment).

Share

My New Pet Orb Weaver Spider

As I was mowing the grass in my back yard two weeks ago, I was startled by a huge spider that crept out from under a board on our fence. I wanted to take some pictures of it but after I finished mowing it was gone. Today, however, the same spider (I assume) kindly relocated itself to a very nice place from which to capture it.

Here’s a video of the spider in action:

Share

Shorten URLs with Zend Framework and bit.ly

This function uses version 3.0 of the bit.ly API. You’ll need to register for an account with them if you don’t already have one. Then you can retrieve your API key and begin using it immediately.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function bitlyShorten($url)
{
	$client = new Zend_Http_Client('http://api.bit.ly/v3/shorten');
 
	$client->setParameterGet(array(
		'longUrl' => $url,
		'login' => 'xyz',
		'apiKey' => 'xyz'
	));
 
	$response = $client->request();
 
	if($response->isSuccessful())
	{
		$response = Zend_Json::decode($response->getBody());
 
		if($response['status_code'] == 200)
		{
			return $response['data']['url'];
		}
	}
 
	return (false);
}

Example:

1
2
$myLongUrl = 'http://www.jeremyglover.com/blog/';
$myShortUrl = bitlyShorten($myLongUrl);
Share