Obvious Ideas

From the desk of a Software Developer

Archive for May, 2009

How To Create a Teapot with PHP

View Comments

Saw on @toolmantim’s blog that he turned his blog into a tea pot. He even made a Rack middleware that can turn any Rake app into a teapot. “Cool! it can be cool addition to Topify, too”, I thought to myself. The problem? Topify is PHP and not Ruby. The solution? 6 lines of PHP code:

And now you can do :

arikfr:~ arik$ curl -i -X BREW http://topify.com/
HTTP/1.1 418 I’m a teapot
Date: Wed, 13 May 2009 08:51:07 GMT
Server: Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2
X-Powered-By: PHP/5.2.6
Content-Length: 29
Content-Type: text/html

We do serve ICE Tea, though.

It’s not as elegant as Ruby code or Ruby gem, but it does the work.

If you use this on your own server, please ping me. I would love to hear :)

Written by Arik

May 13th, 2009 at 11:05 am

Posted in Software Development

Tagged with , , , , , ,

Just Created a Simple Twitter App to Check Who You’re Blocking

View Comments

Just created a simple Twitter app using OAuth that allows you to check who you’re blocking on Twitter (currently there’s no inherent option to see this information on Twitter website). This is very basic and very preliminary – was mainly developed as an OAuth exercise for myself.

I’ve used the PHP twitter-async library and the code sample by @jmathai.

I would really love if someone could help me with the design :)

Looking forward to hear your feedback,
Arik

Posted via email from Arik’s posterous

Written by Arik

May 13th, 2009 at 12:19 am

Posted in General

This is why I love bit.ly

View Comments



bit.ly is the url shortner we all been waiting for since the creation of tinyurl. It’s simply awesome.

Posted via email from Arik’s posterous

Written by Arik

May 11th, 2009 at 9:01 pm

Posted in General

Mac OS/X Tip: How To Change Screen Capture Location

View Comments

I really like the built in screen capture ability of OS/X. I specially like the ability to easily take a screen capture of only part of the screen by using Cmd+Shift+4. What I didn’t like was the fact that it created a hell of a clutter on my desktop with all that screenshots.

Cluttered Desktop

Cluttered Desktop

For long time I’ve been just manually moving the screenshots to different folders / deleting them. But today I decided that enough is enough and looked for a solution. And of course a simple solution exists. To save you the reading here’s a summary of what you need to do:
1. Open the Terminal.
2. Create a new folder for the screenshots by using mkdir, i.e.

mkdir /Users/Arik/Desktop/Screenshots

3. Run the following command:

defaults write com.apple.screencapture location [the-folder-you-created-in-step-2]

That’s it. Almost. Now you need to logout and login again in order for the changes to take effect. Instead you can use the following command (from Terminal):

killall -HUP SystemUIServer

Now you really done.

Hope it helps.
Arik

Written by Arik

May 2nd, 2009 at 12:03 am