We have switched from Apache to Nginx a month ago. PHP is running on FastCGI using PHP-FPM. I have just recently tried to debug our app using FirePHP and got a 502 Bad Gateway response from Nginx. It looks like Nginx by default limits the header output. This is the error in Nginx’s error log: [...]
I was working on a utility class and was playing with the idea of using the id of an object (e.g. NSObject) as a key in NSDictionary. Setting it directly doesn’t work though: NSObject *obj = [[[NSObject alloc] init] autorelease]; // we’ll use this as the key NSMutableDictionary *dict = [[[NSMutableDictionary alloc] init] autorelease]; [dict [...]
So I was able to partition a Macbook Pro 2010 (Snow Leopard) using Boot Camp in order to install Windows 7. I just want to point out this possible solution when you get this error when trying to create a partition: Your Disk Cannot Be Partitioned Because Some Files Cannot Be Moved Back up the [...]
This is a quick fix for PHP errors like these on a Media Temple DV: Warning: include_once() [function.include-once]: open_basedir restriction in effect. I got this a few days ago when trying to setup an app. There are instructions in Media Temple’s site on how to fix this but this set of steps is what worked [...]
This article assumes that you are familiar with the Facebook SDK Core Concepts and know how to request a user’s access token. This also uses the Facebook PHP SDK. Getting the list of friends You can get the friends of a Facebook user using this FQL query: SELECT uid FROM user WHERE uid IN (SELECT [...]
This was tested on CentOS 5.6 on a fresh MediaTemple (dv) setup. I figure it should be the same for any CentOS install. This set of instructions is a result of hours spent on installation troubleshooting; google searches; and trial and errors. Hopefully this can help other people. Install dependencies These are needed to enable [...]
To integrate libraries using namespaces into a Yii Framework project, you can simply use Yii::setPathOfAlias to have the classes autoloaded by Yii when needed. Just specify the root namespace as the alias and the physical location of that root alias as the path. Using Predis as an example, if we put the code in: /vendors/predis/lib/Predis [...]
This is a pattern we’ve been using to organize a big jQuery project that is now composed of 150+ files. When we first started with the project, we kept all page components in their respective jQuery plugins. This was good enough at that time. But as the project grew it became harder and harder to [...]
Yeah, so I’ve been learning Core Data and I keep getting this error during a fetch request: Name: NSInvalidArgumentException File: Unknown Line: Unknown Reason: Unsupported expression type (11, SIZE) An obscure error message, yay! This happened when I used this very simple predicate declaration: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"size == %@", @"medium"]; Like one of [...]
PicPing is an iPhone app we just released as part of the Globe MobApp Hunt. It allows you to connect your Facebook, Twitter, Flickr, and Tumblr accounts. You can then take photos and upload it to all your accounts in one go. It is now available for download on the App Store. I made this [...]