Lighttpd – url rewrite and query string QSA

One of the first things I was curious about when I started using Lighttpd was url-rewrites. On apache mod_rewrites you can use the [QSA] flag to allow for the query string after your new urls. Here is the equivalent in lighttpd. This would go in your lighttpd.conf file which is usually located in /etc/lighttpd/lighttpd.conf on […]

Continue Reading 0

PHP: Handle comma separated input

A quick example of how to handle comma separated input from a POST variable in PHP. The code below will turn your POST variable into an array containing the user’s input which you can further validate or store in a database. This is useful for letting users add tags to items on your website.

Continue Reading 1

iOS tip: Center UILabel in tableFooterView

If you’re building an app that supports portrait and landscape you will probably run into an issue with keeping things centered after device rotation. Below is a quick example of adding a UILabel to a UITableView’s footer and keeping it centered regardless of device rotation. The trick is to use autoresizingMask which does all the […]

Continue Reading 3
SDWebImages-Tut-0

SDWebImage fixed width cell images

While looking for a easy solution to load uitableview images remotely, I came across a great library called SDWebImage. It’s very simple to use and provides a lot of flexibility for loading and caching images in your iOS project. As I started to use it, I ran into a issue when loading inconsistant thumbnail image […]

Continue Reading 16
JQuery. Write less, do more

JQuery: Sorting JSON results

This is a follow up to a previous post on sorting elements using JQuery. A few people messaged me asking how to modify the code to sort JSON results from a ajax request so here it goes. The JSON (json.php):

We’re going to sort these results by the ‘name’ field and apply them to […]

Continue Reading 1

Check image type in PHP

Quick PHP tip: If you’re looking to determine the type of uploaded image you can use the following code:

The code above shows a snippet to check if the uploaded image was a jpg, gif or png image type. As stated on the PHP documentation, this will return the same value as getimagesize() but […]

Continue Reading 0

Powered by WordPress. Designed by Woo Themes