ZipArchive for PHP required by laravel

sudo port install php5-zip


OSX Install Open SSL for PHP.ini

sudo port install php5-openssl


Mcrypt to OSX

add mcrypt to mac os x server

You can easily install the mcrypt extension to PHP5 on Mac OS X Server. Here’s how:

Download and install MacPorts from

The following steps are performed in the Terminal:

Force MacPorts to update:
sudo port -v selfupdate

Now, install memcached:
sudo port install php5-mcrypt

Copy the newly created shared object for mcrypt into Mac OS X’s default PHP5 extension directory:
sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/ /usr/lib/php/extensions/no-debug-non-zts-20090626/

Next, you need to edit php.ini to add the extensions. Find the phrase Dynamic Extensions, and add:

And finally, restart Apache:
sudo apachectl restart

Test if it working

php -m | grep mcrypt


Google Galaxy Nexus - wont start, blank screen

Your new Google Galaxy Nexus is showing a blank screen, wont start, doesn’t seem to charge? 

This worked for me:

1. take the battery out of your galaxy nexus

2. connect your galaxy nexus to your computer

3. when you hear your computer beep or after waiting 5-10 seconds place your battery back into your phone.

You should now be seeing a picture of a battery on your phone’s screen. Try turning it on - it should work now.


2 Notes

KLCK & ChairBro - The tech stack

I was just asked on Twitter how I built KLCK, so here is a pretty good break down of the technology and the order things were done.

For quite some time I have testing and working on different systems and frameworks.  I love Python but didn’t really want to host this app on app Engine and I have been doing a lot of PHP work lately. I have done a site in Ruby on Rails but find it quite complicated to come back to you if you dont do Rails fulltime, I had such a horrible experience hosting Ruby that its really put me off Ruby & Rails, but I love Ruby as language (yes I know about Sinatra).  So this was the technology of choice, probably because it is easy to host and configure and pretty solid at the end of the day (even if it is a bit ugly at times).

So to start off with I built which is powered by 1 file, index.php.

This uses a super simple framework called Silex
Silex allows you to run your whole website from 1 file and manages all your routes etc. Its simple and flexible.

To make things super simple, the HTML uses Smarty Templates which allows you to inherit and extend your HTML files.  In essence you can create a master template file and inherit this into other templates.  Choosing smarty was the best choice I made here. One thing about smarty is that it will compile your templates+code on the first run.  So you templates are not parsed on every request, they are parsed once and then turned into pure PHP code. So KLCK, ChairBro run render super fast on the server. 

I am a real fan of ORM databases, and love this one called Red Bean PHP which allows you to quickly get a DB up and running, I used MySql for the database but for some projects I have used Sqlite. I do recommend MySql for you DB. Red Bean allows you to keep away from SQL (you can still uses it though) so you focus on manipulating object, not SQL statements.

For image manipulation and cropping. which basically allows you to manage image resizing on the fly.  Super simple.

Finally after ChairBro was built I decided to create KLCK using the same engine but different design and different categories. Because I used Smarty for my templates I only had to create a new master template for the site and with some tweaks, I have 2 sites running of the same code base.

How big is it all. Well the 2 sites run off 1 index.php file which is about 900 lines long. This includes lots of comments and some other functions I am not using. 

Result: Love it. Its simple, separated, DB code is terse and concise, templates are logical and very easy to move around and manipulate. runs fast. 

477 Notes

Pilotmoon Blog: Scroll Reverser — get in practice for Lion


You might have learned that a certain upcoming version of Mac OS X may have scrolling that is “bass-ackwards”.

That is, when you push up on your trackpad or mouse scroller, the page content moves up too, just like on iOS devices.

I made a very minimal little app that lets you reverse…

2 Notes

iPhone ad-hoc builds

If you’re concerned whether the ipa file is properly created, go ahead and repeat the Share Application step but save the file to the desktop instead of opening it in Mail. Then unzip the ipa file and look into the Payload folder that is extracted. Inside, you’ll find an application bundle, and inside there, you’ll discover the embedded provision file. Load the file in TextEdit to confirm that the proper UDIDs have been included in the provisioning file.


Don’t Be Ugly By Accident! « OkTrends

A must read on some funny facts about photos and attractiveness.