Web Developer / Blog

Writing your own URL shortener in 25 lines of PHP

Digg this article · Save to del.icio.us · Stumble it!

So you want to write a URL shortener? Let’s make it short and painless. You’ll need two pieces: a key generator and redirector. The key generator is used to represent a shortened url with a series of characters, often a-zA-Z0-9. This is what you see at the end of tinyurl and bit.ly links. The redirector needs to link the key to a url and perform a HTTP redirect. Shall we? Read the rest of this entry »

Letting your users “Sign In With Twitter” with OAuth

Digg this article · Save to del.icio.us · Stumble it!

UPDATE: You can watch me on GitHub, view documentation or fork the project.

Twitter recently added a feature to their API that let’s you allow users to sign into your site with their twitter username and password. I recently wrote a blog post on how to use Twitter’s OAuth API. This feature is a natural progression in allowing Twitter users to securely sign into your site. Read the rest of this entry »

How to quickly integrate with Twitter’s OAuth API using PHP

Digg this article · Save to del.icio.us · Stumble it!

UPDATE: You can watch me on GitHub, view documentation or fork the project.

A new project I’m working on integrates closely with Twitter. As a result, I become a lot more familiar with OAuth than I care to. Many developers want to be able to speak the OAuth protocol without having to know the fine details. I am deviating from the normal order by starting with an example and explaining it afterwards. If you are interested in using “Sign in with Twitter” then read my other blog post. Read the rest of this entry »

How to host the php.net manual on your laptop for offline use

Digg this article · Save to del.icio.us · Stumble it!

In a previous article I wrote about how to develop web applications locally on your laptop. In addition to being faster to develop, it lets you work without needing to be connected to the Internet. But what about the tools you use while developing? If you’re a PHP developer then the manual at php.net is an invaluable tool. It only make sense to have it available for when you’re not online.
Read the rest of this entry »

Caching memcached, what are you waiting for?

Digg this article · Save to del.icio.us · Stumble it!

Caching is often looked to as a first step in making something faster. Let’s face it, complex or frequent data access is expensive. As a result, everyone and their mother manager turns to caching for a magical shot in the arm. However, an often overlooked fact is that accessing a cache isn’t a NOOP. Read the rest of this entry »

['yahoo', 'google', 0, 'amazon', 'ebay'].search(’facebook’) === true … in PHP

Digg this article · Save to del.icio.us · Stumble it!

A coworker of mine found some peculiar behavior in some code we had. We had an array with several values like you see in the title. We checked values in that array using PHP’s array_search function. While the string being searched for wasn’t present, the function was returning true. Initially perplexed by this we realized quickly after looking at the source of PHP’s array searching function we noticed the problem. There’s a second parameter to the array searching functions which tell PHP to do strict comparisons. This is in their documentation at http://php.net/array_search. It makes complete sense since PHP is loosely typed. But it’s not at all intuitive at first glance. Read the rest of this entry »

Developing web applications locally on your Mac OSX using MacPorts

Digg this article · Save to del.icio.us · Stumble it!

I’ve long been a proponent of developing web applications locally on my laptop. It’s amazing how much time you can save when you don’t have to transfer files to a development server or wait for a file to save over the network. You can also do development when you’re not at the office, vpn’ed or even have an internet connection. However, the most compelling reason to do it is because it’s relatively trivial. Read the rest of this entry »

Interview questions from Google, Yahoo!, O’Reilly and a few startups

Digg this article · Save to del.icio.us · Stumble it!

Just over a year ago my wife and I decided that we’d consider moving from Cincinnati to Silicon Valley.  I’ve always found it difficult to find work that I enjoyed in Cincinnati.  That resulted in me being involved in two startups, neither being successful :).  As part of the process my friends who were also considering moving and I documented the questions we were asked during interviews.
Read the rest of this entry »

Using the Facebook API to upload photos

Digg this article · Save to del.icio.us · Stumble it!

Facebook’s photos and albums are no way to truly store or organize your photos.  It is however one of the best ways to share them.  This created quite a conundrum for me as I had no interest in uploading photos to two different websites.  I don’t use Flickr or Smugmug or any other photo sharing service that you’ve heard of.  Since I was a co-founder at Photagious it’s a natural choice as my photo management site. Read the rest of this entry »

OSX + Quicksilver + Firefox + Delicious = Bookmark Heaven

Digg this article · Save to del.icio.us · Stumble it!

Quicksilver is the only OSX application that I couldn’t live without.  It’s one of those pieces of software that changes how you accomplish your most frequent tasks.  Here’s short list of the things you can do much faster than you could otherwise: open applications, send emails and more.  But one of my most frequent actions is to pull up specific web pages that.  Normally, I would bookmark these but we can do much better than “normally”. Read the rest of this entry »


About this site:
This is my (Jaisen Mathai) personal site for potential employers who want to see my resume or portfolio. My ideal job would be to work as a Web developer on a large scale consumer website. My experience is in using PHP, MySQL, Ajax and JSON. I really enjoy creative brainstorming...taking a problem apart and narrowing 100 solutions down to the best one.

Thanks for stopping by. Be sure to drop me a line.