Sunday, February 19, 2012

if-ify, for-ify, foreach-ify and func-ify

A common question among developers is how to surround the current selection in the editor with a parent statement. For example if you start coding a statement that validates an expression and then want to iterate over an array of expressions and do the same to all its elements.

For this end Eclipse templates provide two variables "line_selection" and "word_selection" that help you build custom selection-based wrappers.

In this example three new templates were added to simplify this scenario:



You can import these templates (xml below) to your IDE via Preferences > PHP > Editor > Templates > Import...

Wednesday, February 01, 2012

How My Wife Drives the Technology World

ok, maybe a better name would be "My Cloud-based-Social-enabled-Service-oriented Mobile Apps Experience", but that's a long name for a post :)

It started last week as a small-talk between my wife and me about she attending so many shifts and medical sessions. According to my wife, she usually takes 4-5 shifts a month where the actual number is doubled (!). At that moment I had no tools to prove my point and here comes the requirements to build a small mobile app for her to report shifts and sessions while being able to write short notes about it (ok, she was asking this a long time ago). In addition she usually posts some info on Facebook during her shifts so I had to connect these reports somehow to her Facebook account. By the end of the month she hand a report about her shifts to the managers so this if the app could also print a summary it will be a big value for her.

Before sharing thoughts about my experience with this app development, here is how this app looks like on Android and iOS:


Mobile App
jQueryMobile (version 1.0) is really handy for creating cross-platform mobile interface, it provides easy to use APIs and is really covered well with lots of great examples. I had to use several other libraries like jQueryUrl, Moment.jsMustache, requireJS and jsPDF. With so many "out-of-the-box" libraries it is super easy to build robust solution for client side in minutes(!!!)

Social-enabled:
Facebook JavaScript SDK helped me with giving a more "social look and feel" after creating  a  Facebook application. I also used  Facebook's OAth service authentication and Open Graph integration so users notify their friends about their activities with the "My Doctor Shifts" application. That's super important to engage the application users to your application!

Service-oriented (and Data-centric)
Zend Framework provides nice (lightweight) models representation and the MVC was useful to create the HTML view and services.

Cloud-based
Using  phpCloud was easy as always with plenty of slick workflows helping me to easily deploy my application and push updates to staging and testing targets. This way I always kept two versions that represent my Work in Progress and Done apps. I also got packages ready for deployed in case I want to deploy it to another Zend Application Fabric instance.

The application is available on github.