Concatenating PDFs with PHP on the fly

One of my projects I was working on required PDFs to be concatenated/built on the fly from a stock set of 20 PDFs. Based on questionnaire answers, any 4 of the 20 + a core PDF would be concatenated together and provided for either email or download.
The first solution I saw was just to talk [...]

⇥ Read the article in full

About

yeah, just my thoughts ladies and gentlemen.

Read More   ⎋

Subscribe to RSS Feed

Recent articles

Sync Mac 10.5 iCal and Google Calendar

In the past this was a difficult task on Leopard. It required *gasp* the purchase of software. Typically I am against that, but if the software is good, or performs a task that there is no free alternative for, I’ll buy it.

This was the case with Spanning Sync. I want all my calendars synced across all my computers and my phone. I had no trouble getting Rainlendar synced to Gcal on my XP machine. There wasn’t an alternative for os X 10.5. I looked into getting GCALDaemon set up, but I couldn’t figure it out.

I finally came across Spanning Sync, which was a cool little piece of software that did the job for me. It worked great. But alas I have come across a free solution!

Recently, Gcal added support for CalDAV, a protocol that “allows multiple client access to the same information thus allowing cooperative planning and information sharing.” Wikipedia This generally means there is now a free alternative to syncing iCal and Gcal. Get setup syncing Google Calendar with iCal using CalDav.

There are it seems a few issues with Gcal CalDAV vs Spanning Sync.

CalDAV cons

  • Event reminders/alarms don’t sync
  • Event reminders/alarms don’t sync
  • iCal errors when changing the calendar name/color
  • Unable to create iCal To Dos for Google Calendar
  • Unable to create new iCal calendars for Google Calendar
  • Google Apps: Room scheduler is not supported
  • Google Calendar events don’t appear in iCal

I did a little poking around on Spanning Sync’s Forums and found some advantages of Gcal CalDAV vs Spanning Sync.

Spanning Sync lets you select which calendars you want paired up and
synced. Meaning, I could sync a gCal calendar called “Tasks” with an
iCal calendar named ToDo, for example. In addition, Spanning Sync also
syncs your address book and gMail contacts. Original.

It’ll certainly be interesting to see if Spanning Sync Will remain my choice (since I’ve already got the lifetime license) for syncing iCal and Google Calendar.

Code Snippets: Edit hosts file in Mac OS X 10.5 Leopard

I do a lot of development in Leopard. Typically for most projects there is a sandbox set up to mirror the production server. I’ve found the easiest way and best practice to work on the sandbox is to change the IP to forward to the production domain.

What you do is open Terminal, which is found in Applications > Utilities. Then type the following:

sudo nano /etc/hosts

Terminal will then ask you for your password, because you have invoked the security privileges of the superuser. Type your password in. Nano will then open. I know you can use VI but for such a simple task, I prefer nano.

Next you will be presented with:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost

Just a few things to note. A hash, #, is a comment. Don’t mess with those first 4, unless you know what you are doing.

Move the cursor down in nano using the arrow keys. Now you can type in an IP address of the staging server and have it appear to be on the production server domain name. Our theoretical staging server is on IP address 111.111.111.111 and our production server is on IP 11.111.111.112, with the domain www.production.com


127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
111.111.111.111 www.production.com

Now save. This is done by hitting ctrl+o or ^o. Hit enter to name it hosts, then hit ^x to exit nano. In order for this to work the cache needs to be flushed. There is a new command for this in 10.5 Leopard.

dscacheutil -flushcache

Now you can go to your staging server via your production domain name. Handy. Just be careful though. Don’t accidentally make edits to production, or think you’re making edits on production but you’re making them to staging.

Code Snippets: Add comma’s to a string

Pretty commonly I’ll need to display a string of text that needs to be comma delineated using PHP.  This is the easiest way I have found to accomplish this.

<?php
$string = "test test2 test3 test4 test5 ";
echo substr(str_replace(" ", ", ", $string), 0, -2); //outputs test, test2, test3, test4, test5
?>

Make sure that there is a space added after every test or otherwise you’ll end up with the output test, test2, test3, test4, tes.

This could also be adapted into a function, if you wanted.

Apple picks up some awards and new iPhone to market soon

To begin with someone close to the 3G iPhone project has mentioned that it should be released sometime next month.  3G should finally bring full fledged high speed internet to the phone, which some people have been waiting for.  Also there may be a different color of the iPhone on the horizon, don’t get too excited though, it’s just black.  This image via AT&T’s web site shows the phone now available in black.  Via Gizmodo and AppleInsider.

Apple has always been known for top notch design of its hardware.  This year they have been winning some prestigious awards for their design.  For years Apple has taken home many D&AD awards, but this year they swept up.  For those of you who don’t know D&AD “is an educational charity that represents the global creative, design and advertising communities.”  

In the product design category they won five pencils for the keyboard, the iMac, iPhone, iPod Touch, and the iPod Nano.  So, I guess there is a reason to pay for well designed devices.  What do you think?

Ah great: site down for a few days.

UPDATE: As you can see my site is back for the most part.  I just need to add the theme back in, which I’ll do soon.  Thanks for your patience.

Seems some hackers exploited my Wordpress 2.5 some how.  It’ll be a few days before I get everything back up and running again, since I’m pretty busy with school right now.  Sorry for the inconvenience.

Two slick apps worth checking out… forward hotmail to gmail… and keeping your apps fresh.

I’ve been looking for some better ways to do things recently. I found two pretty cool apps that make computer life a little simpler.

If I’m anything like you, I’m sure you have one too many email addresses. I recently started looking for a way to consolidate several of them to my gmail address. I’m sure like you too you’ve got that old hotmail address sitting around that you still check every so often. Now if you’ve searched for a solution to forward hotmail easily, there isn’t one. Microsoft does allow you to forward your address to other Microsoft owned sites, but what good is that.

So after a little research I found Mail Forward. It allows me to forward my hotmail address to any address I want. Awesome. You can also forward Yahoo, AOL, MSN addresses among others.

Mail Forward can be found here. There is also a Windows version too located here.

CNet used to have a service called Update. The program scanned registry (yes, it was a Window’s app) and determined what programs you have installed are out of date. Then it provided links for downloads for the updates you needed.

I found a app called AppFresh, that pretty much does the same thing, but for Mac. This lets you know what needs to be updated and will even download and install the updated application for you. It is integrated with iusethis, which is “way for you to organize your applications as well as discover new ones. You can also use it to check if your apps are up-to-date.”

I’d recommend taking a look at AppFresh, though it is in beta, maybe there is another app out there that does this that isn’t in beta.

Let me know what you guys think!

How to get the most out of your Mac laptop battery.

Everywhere I go on campus I see people on their laptops. Their usually hunched over, sitting on the floor, next to an outlet. In fact it is almost a strange sight to see people not charging their laptops.

I don’t normally bring my charger with me, I guess I am one of the lucky ones. I get about 3.5 hours of usage on battery. I haven’t always been lucky though. My old HP with its 17″ wide screen and turbo jet engine fans only got about 1.5 hours, though I never took it anywhere because it was so big and heavy. Those times are over, I have a great portable laptop that I don’t have to be constantly searching for an outlet in order to use it.

So here are a few tips I’ve found to get the most out of your battery.

Don’t leave your laptop plugged in all the time, if you do, you might as well remove the battery and store it with a half charge. This might not be true anymore with Li Ion batteries. I’m not sure… someone will know in the comments.

Turn down the monitor’s brightness.

Avoid using the CD/DVD drive.

Turn off the keyboards backlight.

Turn off Bluetooth, Airport, Sync, System Sounds. If you’re not using them, don’t turn them on.

Cut down on running applications.

Remove external devices like mice, iPods, other USB devices.

Use Safari. It may just be me but Firefox is slow with all the Add ons and memory issues.

Change your power settings to “Better Battery Life”. This will often change your processor power to enable longer battery life.

If you notice your fans are turning on more and more, they could be clogged with dust. It’s worth spraying them out with a can of air to get the debris out of the heatsink and fan housing. It was hard to believe how much dust choked my HPs fans.

If all else fails, it might be time for a new battery. That may not be a bad thing since some non-Apple batteries have higher capacity then original Apple equipment.

Hopefully these tips will help free you from your laptop’s power brick.

Revisited: Finally Adium for Windows.

At the time of drafting my original Adium for Windows article, I had no idea the level of popularity it would have. Oddly enough, my Windows XP laptop died not too long after writing the article.

Let me clarify something. There isn’t Adium for Windows. The developers have made it quite clear that, “Unfortunately, Adium is written with very Mac specific code. Porting it to another platform would require rewriting the entire application.” – Adium Trac This is unfortunate, because most Windows users are still stuck with AOL Instant Messenger, which is a huge resource hog. If Adium entered the PC market they would probably take away a lot of market share from AIM and Trillian.

With Windows XP, there are a few alternatives to Adium. Pidgin, which runs the same libpurple engine, is pretty basic. It uses GTK+ themes so there are plenty of the out there. In terms of overall customization, you are kind of limited by GTK. If you’re looking for a nice simple IM client that just works; Pidgin is for you.

Next is Miranda IM. I will be the first to admit, it is not as simple Adium or Pidgin, but in terms of customization this is the one you want. This program needs more polishing in terms of usability, but it sure is skinable.

There is also Trillian, but I never really got into it.

I also found this neat program called Ahoihoi, which is built on the Open AIM. It’s TOO BAD that it isn’t FREE, but there is a trial. I wouldn’t mind getting my hands on a full version. It looks like it has potential. I don’t know if there are skins for it.

The bottom line is… if you want your IM client to LOOK like Adium, go with Miranda. It won’t be quite as easy to use as Adium is but at least you can have a better looking client.

You may want to check out the Comments on the original post as some of them are VERY helpful.

Getting things done with RTM and Jott

I’ve always wanted a personal secretary.  Then again who hasn’t?  I am constantly forgetting things, unless I write it down.  My system never worked all that well.  I could never find a pen or a suitable piece of paper when I was scrambling to write a thought down.

Recently I have found something pretty cool.  I’ve been using Remember the Milk (RTM) for the past month and I’m loving it.  At its core RTM is a to do list manager.  The beauty of RTM is the fact that it integrates with everything.  I’ve got it plugged into my iCal, iGoogle and iPhone (if I owned one).  You can take it offline with Google Gears.  Its pretty handy.

The only downside is you have to be around an internet capable device.  BUT I found a service called Jott.  Now I never go anywhere without my cell phone. Jott allows me call their service up and leave voice notes, which are then transcribed.  Jott plays nice via RTM’s API.  So the ‘jotts’ are sent to RTM.

Both Jott and RTM are very similar, you could probably get away with using just Jott, but when you combine both of them it becomes an extremely efficient way to combat forgetfulness and get things done.

A month with Leopard

I finally got Leopard setup on my PowerBook. So far so good. I went out on a limb and decided not to do a fresh install. I would never have done that on windows. Oddly enough everything works. Everything but UNO, but I don’t really need to use it because Leopard has a unified theme.

Strangely enough, my powerbook is my only computer left. My HP died and I feel like its time for an upgrade on that guy. I’ll be listing that on ebay sooner or later, if anyone is interested send me a comment.

Okay Leopard review…

For day to day usage, nothing has really changed, just add stacks.  I have noticed that my PowerBook runs faster, which is nice since it is an aging computer.

I have a hard time deciding between using firefix or safari.  I like safari because its native and runs faster.  I like firefox because its firefox, but in 10.5, it isn’t unified like it was on Tiger with UNO.  I’ve switched back to firefox  safari since initially drafting this.

Everyone seems to have a major hang up about the new mirrored dock. I’ve never seemed to have a problem with it though.  I can see what programs I’m running even with the dock at its smallest setting.

I’m a fan of stacks, to some extent. I enjoy the download stack, but I’ve yet to figure out how to quick look items in a stack.  I don’t think you can, but I’ve heard rumors of stack fixes in 10.5.2.

Quick look is handy.  Its nothing to get too excited about.

I like the iCal updates, but I can’t resize the calendar list as small as I’d like it.  I may be crazy but when you’ve got 12″ you’ve got to make the most of every bit of screen you can.