Archives for posts with tag: php

In this post I’ll outline how to setup and connect a thrift client in PHP. If you’d like to learn how to setup and run a thrift server please see my friend Mike Cvet’s post here on setting up a C++ thrift server.

You’re in a meeting and some Sr. Dev from the systems or backend team says: “Great! just connect to my service via thrift, we already handle all the db connections and most of the caching. You guys use Ruby right? oh..  PHP? that’s cool too, sweet! *looks over to the PM* We should be done in a week…”. Oh snap! A week? What is this thrift thing? And what is this Ruby thing all those young whipper snappers keep talking about!?”. (Yes this is the use case I wish to satisfy with my post)

Apache Thrift is a great RPC framework originally developed and released by Facebook (added to the Apache incubator back in 2008).  I’ve used thrift for the last few years as a simple / efficient way to exchange data across machines, applications, and languages.  A coworker and I thought it’d be cool to do another Thrift tutorial, because at the time of this post, the official tutorials are being developed.  Following the nature of thrift, we also thought it’d be cool (we are nerds) to split the tutorial across 2 different blogs, I will explain the client, he will explain the server.   As a quick warning, this tutorial is rather verbose, I like hearing myself talk… Feel free to skim through the code if you want to skip my life story.  Warning #2, I wrote this tutorial after drinking an entire bottle of wine, you have been warned.

Download Source from GitHub – Client and Server

Read the rest of this entry »


I have seen some absolutely stunning Twitter wallpapers and one thing that always sparks my imagination is living in a world of constraints.  Twitter gives everyone the same template, and lets us change colours, background images, but that’s about it.  When we, (myself, @kenstruys and Jason Tigas) were developing Thoora’s company twitter feed, we wanted to do something cool.  There was one area on the Twitter profile page we had some control over, even though most people wouldn’t think the control exists:  Recent Followers, and the Twitter mosaic was born.

So.... who has your company followed recently?

And just in case you missed it:

Now we did what we could, and Twitter so graciously gave us a nice 6×6 grid to work with.  So 36 Captcha’s  later – we had our very own custom module on our page.  We played around with having a mini version of our site embedded into the mosaic (each tile linking to the twitter account of a subsection of our site) but it seemed a bit overkill. Our Creative Director wasn’t too thrilled with kerning on the letters: t-h-o-o-r-a, but I really wanted to push the company name out there.  We were also able to nicely squeeze our logo mark (the thoora man) nicely into the grid.  For those curious, here’s a shot of one of the tiles:

All accounts are public, so feel free to mosaic your own page with us ;)

So that was a nice little afternoon hack which we put together a few months back.  Yes, I realize there is some branding inconsistencies here:  The logo mark is chopped up, the kerning is all wrong on our font… but the Thoora man got stuck in people’s head, and that’s what we wanted.  So here is a quick app idea, create a pixel account for every color in the RGB spectrum, then make an interactive tool allowing users to draw whatever they like in their “following canvas”.  If you make it, I’d love to try it out!  (Although the 24^2 * 36 pixels is a hell of a lot of Captcha’s).  Lastly, if you were wondering, we wrote a script to follow the accounts in order, so we are 1 line away from having a branded Twitter account. Thanks to David Billingham (@slawcup) for the PHP API wrappers. Usage: php script.php username password

Read the rest of this entry »