devin smith

Devin Smith

a los angeles based web developer, designer, software developer, opensource, video, nerd.

December 25th, 2010 @ 12:20 pm

While building my new blog's comment system I decided to just be lazy and use some other api. For this I decided to use the facebook API. I had previously built a comment system using a modified PHP API, but this time I had no reason to need to run it through my own backend. Adding the comment box is extremely simply and only needs to use the fb:comments XFBML. it looks a little like this. By specifying a url we can make sure that the likes for the page stay the same even if the title or…

November 9th, 2010 @ 11:37 am

Recently I had a need to gather a group of images, add a watermark, and zip them up so a user could download them. Instead of create all of these zip files each time anything is changed, I instead wrote a class to do this all for me. This class requires Caffeine_Zip and Caffeine_Thumb. Once our class is set up, we now need to use it. // create the zip $zip = new myZip(array( 'destination' => './zip' )); // give it to the user header('Location: /zip/myzip.zip');

November 9th, 2010 @ 11:37 am

Tracking downloads is wonderful, but when you have large downloads like movies, people often cancel them before they finish. In order to track completed downloads properly, we have to run the download through PHP. This class requires Caffeine_File and Caffeine_Table (optional). First lets create our access class. This will work with our tracking database to log a started and finished download. Next we extend the file class. We will create an entry in the database at the begining of the…

November 3rd, 2010 @ 11:37 am

The Caffeine Table class is one of the biggest time savers when working with mysql databases. It is an object based version of database manipulation. One of the previous performance problems with it however was when creating lots of empty objects it would load all the fields based on the columns. Not anymore! Now we instead cache all the fileds in the database object. Performance!

October 4th, 2010 @ 11:37 am

Loic needed a simple separate webpage to display his print for a ghettogloss event. This entire page is controled by a single easily editable xml file that he manages. Another ghetto yet easily maintainable CMS.

September 23rd, 2010 @ 11:37 am

osFileManager is a PHP Filemanager origionaly written in 2003, and with little improvements since. Includes User CP, Admin CP, and many basic file creation/modifying tools. Alows user defined themes as well. File Functions include: List, Open, View, Edit, Create, Upload, Rename and Move. User Functions include: Change password, and Change color scheme. Admin Functions include: New user, Edit user, Delete user. https://github.com/arzynik/osFileManager

September 5th, 2010 @ 11:37 am

We all have databases full of data, but how do we track who changed what? The easiest way for me is to create changeset tables. Lets start with a table that holds messages for a basic PHP app. Our schema Our object class Message extends Caffeine_Table { public function save() { // this performs all the magic for saving all the changes into the appropriate tables. $this->_changeSet = new Caffeine_Changeset(Caffeine_Changeset::save($this)); parent::save(); return…

May 16th, 2010 @ 2:51 am

e338 is the website of Loic Zimmerman, a French born and raised artist and character designer. He does both 2d and 3d art. The website is a very slimed down version of Caffeine. All of the images are pulled from his flickr library where he can manage his photos without the need for me to design a UI. The homepage is simply displaying all images from the featured photoset.

May 10th, 2010 @ 2:51 am

phpFlickr is a PHP library for use with flickrs powerful API. Recently I had a need for a very simple photo gallery with a minimal budget, so we decided to go with hosting all the images on flickr and accessing them remotly. The biggest problem with this idea was what we wanted to do with the photos. Flickr allows you a decent range of size options to display. None of these sizes where exactly what we wanted. In order to resize these server side we needed to first download the images, and…

April 1st, 2010 @ 12:20 pm

Developing in safari has always been somewhat of a pain. But the developer menu makes things a little easier.1. Close Safari2. Open Terminal3. Enter the following into Terminal and press enter 4. Open Safari and you now have a fancy develop menu!