Mindblip – Web Dev, Punk, PHP, Cake & Geek Stink

"This is another boring wordpress blog, reads the same as all the other ones!"

Mindblip – Web Dev, Punk, PHP, Cake & Geek Stink header image 1

Test, Testing & More Testing…

August 6th, 2010 · Web Dev

With Twitter down for most of the evening I decided to revert back to old fashioned coding and research for an evening’s entertainment. Test Driven Development (TDD) is something that addresses so many limitations in web development. Thanks to Wapple, I got the amazing opportunity to attend a conference in Boston, USA over a year ago. The main focus of the talks were Agile Development, Continuous Integration & Xtreme Programming (XP) practices as well as TDD. Jason from Smart Bear software gave a great talk on Pair Programing and Code Review. I took a lot away from those few days and the ideologies presented also helped me decide to switch from developing an in-house PHP OO framework to using CakePHP. I strive to adopt as many of the approaches above at MindBlip to help the team become better developers with the aim of bug-free code. Is there such a thing?

With the stable release of CakePHP 1.3, the test suite is fantastic. Introduced in 1.2, it adds real power to any web development culture and test driven development should definitely be reviewed by every development house out there. If you’re not at least aware of the advantages and limitations then I have compiled a short list of great blogs I have used to advance my own understanding. Most are CakePHP focussed, however, SimpleTest works for PHP so can be used by any PHP developer. There are other Test Suite available for any self respecting language :-)

Introduction To Unit Testing by Debuggable

CakePHP Manual – Testing Chapter – Covers Unit Testing & Web Testing

Why everyone should write tests? – CakeBaker (Old, Old article)

12 Reasons To Get Addicted To CakePHP – It’s all about the Community, give something back

CakePHP 2.0 looks like it’s switching from SimpleTest to PHPUnit – Mark Story explains all!

That’s my 10 pence worth, hope it’s helpful

→ No CommentsTags:······

Talent, Enthusiasm & The Bigger Picture

July 15th, 2010 · Web Dev

Back in Jan ’10 MindBlip was me and only me. In a relatively short space of time we have grown to a team of 4 talented and enthusiastic developers. We are a small company responsible for its own success.

Along the way a major part of the journey, from sole trader to development team, has been getting out there and meeting other startups, established companies and like minded developers. Every single person has been unique, interesting and an inspiration. I have been forced outside of my comfort zone on a regular basis and made some great friends and invaluable experiences.

There’s plenty of stuff going on you just might have to look to find it. Twitter is great for keeping tabs on events.

For developers in the West Midlands, take a look at:

#Multipack
#TechWednesday
#StartupMill
#PHPWM
#wmrug
#sblug

For entepreneurs amongst us there are some great startup camps, networking events and workshops that are available every week.

Not so much about development this post, more about empowerment.

See you at the next event

→ No CommentsTags:····

Birmingham Web Dev & JQTouch Goodness

June 14th, 2010 · Web Dev

Evening all, it’s been a long, long time…

Today I attended a workshop for JQTouch held by Simon @ Flipstorm. It was great to meet up with enthusiastic developers who embrace the capabilities of new web techniques. I found out about the workshop via Multipack and also Joel is a prominent figure in the local community with his fantastic product OnePage. I went to the last Startup Mill event which was also a huge motivational factor in driving forwards with MindBlip.

JQTouch is a JQuery plugin for mobile web development on the iPhone,
iPod Touch, and other forward-thinking devices such as the Android OS.

The session began with Joel and Simon providing an overview of the JQTouch JS library and their experiences using it. The open discussion provided a fantastic forum for the different ways to implement JQTouch and to minimise the number of HTTP requests improving the response times of the Web Apps.

We discussed the pros and cons of native apps, web apps and mobile development in general. Apple vs Google open standards etc. All very geeky and enlightening.

We use CakePHP extensively and the implementation of JQTouch into an MVC framework was the main goal of the session for MindBlip, to understand strategies for integrating this into a single codebase.

There are 2 main approaches to implementing JQTouch:

1.   Create a single view file containing all the views for the Web App

- reduces HTTP responses

- super fast response times

- smooth animations and instanteous interaction

- slower app load times on startup

2.   Create a view file for each individual view

- increased HTTP response times

- fast inital, startup load times

- great level of application, dynamic data

- easier integration with MVC framework

Ultimately, the design architecture of the app will be ditacted by the requirements and backend data integration required. For simple, example info apps, a single view file for the entire app would be fine. However, for larger apps a hybrid approach is definitely required.

A challenging aspect of a JQTouch integration was how to implement an Auth system including login, registration and restricting non-authenticated users from areas of the application. It can be done with Ajax request on every page, however, there must be a better way. Any ideas?

For next time, we will be developing an app in JQTouch and addressing offline functionality, data sync and themes. If this session is of interest, don’t hesitate to get involved, the plan is to meet monthly!

Finally, here are some useful links for getting started:

JQTouch – http://jqtouch.com/

Google Code – http://code.google.com/p/jqtouch/

Google Group – http://groups.google.com/group/jqtouch

Have fun and keep me posted with how you get on.

Paul

→ 1 CommentTags:·····

Fat Models, Skinny Controllers – MVC as it should be!

January 13th, 2010 · Web Dev

Yes, it’s still snowing it the UK and I’m still delving ever deeper into CakePHP.

On my reading list for this week a collection of articles that tackle the design of your code and the greater priniciples of MVC. In my humble opinion, it doesn’t matter whether you’re using CakePHP, Rails, Zend or another MVC framework, the principles should be true for all.

I have a small confession, some of my controllers aren’t just fat, they’re obese. All that is changing…

So without further ado, here’s some great articles and discussions on the subject:

MVC – Fat Models and Skinny Controllers

The M in MVC: Why Models are Misunderstood and Unappreciated

Controller makeover (from ugly to beautiful)

Fat models, skinny controllers and the MVC design pattern

Where should my code go?

Fat models and how they change how you use the Model class

Fat Models, Skinny Controllers

CakePHP Best Practices: Fat Models and Skinny Controllers

Have Fun!

→ No CommentsTags:···

Snow Blindess & 2 CakePHP Tips

January 6th, 2010 · Web Dev

The weather has turned mighty cold in the UK and the ‘Big Freeze’ is upon us. The cold weather means much more time spent creating projects in CakePHP.

Only days into the New Year and I hit my own code freeze and encountered 2 very frustrating issues. I always try to develop with strict adherence to the conventions of any framework and use the tools and features available. The CakePHP docs have come on leaps and bounds and the IRC is always full of helpful people. In both situations alternative implementations were possible, but I really wanted to conform and utilise the cools tools afforded to me by using an MVC framework.

For those not interested in my ramblings here are 2 tricks that will hopefully save you hours:

1. Paginator HelperHow to append query string variables to paginated links:

If you want to append query string values to paginated links, there is an undocumented parameter for the ‘url’ array parameter that will really help.

array(‘?’ => ‘param1=1234′)

or

array(‘?’ => ‘param1=1234:param2=abcd’)

An example:

echo $paginator->prev(‘Previous’, array(‘url’ => array(‘controller’ => ‘pages’,'action’=>’test’,'?’=>’a=1′),’escape’=>false));

2. DatasourcesModel Save() not working:

I had created a custom datasource that uses a third party API. No database is involved and using the datasource tutorial in the CakePHP docs was able to get find() operations on my model working quickly. CakePHP datasources are awesome, well worth investigating if you haven’t used them yet!

However, my model Save() was not calling beforeSave() or the create() function in the datasource. After a solid hour of checking the app_model for overrides and exploring the cake libs I discovered that as well as defining the _schema in the datasource (as I had done) you must define a _schema in the model you are using as no database is used. With a schema in place it all worked as expected.

With a visible sigh of relief, I had overcome 2 problems that were beginning to really make me question the use of one framework over another. The help that I have received from fellow developers, google and IRC has fully restored my confidence in just how good CakePHP is.

Big Thanks to all those who contribute to the project and hopefully I’ll be attending the next CakeFest. See you there!

→ No CommentsTags:··

Blog Action Day: Climate Change + Apathy

October 16th, 2009 · Uncategorized

Everytime we hear about Climate Change, Enironmental Issues and Governmental proposals it’s easy to switch off – too easy. I went to school in eighties Britain and the global climate change message hasn’t changed. I remember doing projects on the ‘Greenhouse effect’ and understanding the issues at the age of 9. So why, now aged 30, is the message still the same with a hint of urgency? For me it all comes down to apathy and inaction. The inability of the individual to do something. I watch the global protests on TV whilst channel surfing! I am a great believer that people are more intelligent than the marketing, brands and mass media gives us credit for. I know what the issues are, I know what can be done so why don’t I. I do… (hesitates) I recycle, I switch off lights, I put the Sky box on standby. Is it enough?

For me the climate debate rages at a high level, but you can make a difference. Just by acknowledging that it exists, by accepting responsbility as an inidvidual and also being honest with yourself that you already knows this. You are empowered.

So what can we do? There are thousands of bloggers currently taking part in Blog Action Day 09 – Climate Change. There will now be a million web resources linked in. If you need more info on the issues and resources, go there. Knowledge is Power, Arm Yourself.

My message is simple, be honest, you already know this.

With anything in life, getting motivated, making a change, lifehacks etc an emotional attachment makes the process easier. I use Music! I have formed emotional attachments to thousands of pieces of music over the years. Each time I hear a particular track it transports me to a moment in time, a feeling, a smell?!? Don’t understand estimate the power of such triggers.

For me, The King Blues ‘Punk Never Happened’ is my motivation when making a change. For others I know, Baz Luhrmann’s Sunscreen is as powerful.

The point is go find that track, accept what difference you can make as an individual and have fun!

Time for the obvious: If we all did this, there would be far more soultions to the problem.

In the spirit of recycling, here’s an extract of the lyrics from ‘Punk Never Happened’ by The King Blues:

“So don’t let anyone tell you you’re not worth the earth,
These streets are your streets, this turf is your turf,
Don’t let anyone tell you that you’ve got to give in,
Cos you can make a difference, you can change everything,
Just let your dreams be your pilot, your imagination your fuel,
Tear up the book and write your own damn rules,
Use all that heart, hope and soul that you’ve got,
And the love and the rage that you feel in your gut,
And realise that the other world that you’re always looking for,
Lies right here in front of us, just outside this door,
And it’s up to you to go out there and paint the canvas,
After all, you were put on the earth to do this,
So shine your light so bright that all can see,
Take pride in being whoever the fuck you want to be,
Throw your fist in the air in solidarity,
And shout Viva la punk, just one life, anarchy!”

Oh, if you’re wondering why I am posting my Blog Action Day post article on the 16th (a day late) could it be laziness or deliberate? The fact is I bothered! Apathy sucks!

→ No CommentsTags:

CakePHP Stylesheet Issue – Not What You Think!

September 17th, 2009 · Uncategorized

Upon starting a new CakePHP project I follow the same series of actions. Downlad the source, extract, create a vhost on local dev server (Ubuntu Jaunty), create a SVN repos, create the db, bake the project skel and hey presto it all works (within a matter of minutes).

Not today though…

I know not everyone will be affected by this but if you find that the CakePHP installs correctly, connects to the database, tmp is writable but your stylesheet does not load it is a Mod Rewrite issue and not CakePHP.

Basically I had been messing about with some Apache config and now I have to enable AllowOverride All in the virtual host to get rewrites to work.

Some other things to check:
1. ModRewite apache module is installed
2. Do other sites using Mod Rewrite work on the same server? – check their vhosts configurations too.

Just thought this may be of use to someone with the same situation.

→ 2 CommentsTags:

Sun, Purple Cow’s, CakePHP & WAPL

August 26th, 2009 · Web Dev

I know I start every post with this one but it has been a while…

Had an amazing holiday in Thailand with the family. Erin loved every minte in the pool and it was great to catch up with the in laws from New Zealand. An amazing place with great food. I came back very refreshed and a more than little enlightened.

Holiday reading was ‘Small Is The New Big’ by Seth Godin. A great book full of lots of Seth’s blog posts. Very inspiring. I recommended it to a friend who promptly replied “That’s what she said”. Check out Goodreads.com if you haven’t already. If anyone has any suggestions for more inspiring business / computing books please let me know.

Onto business…

I’ve been busy coding a hell of a lot lately, so much so that I am managing to cope on a couple of hours sleep a night. Burning the midnight oil has it’s pros and cons:

  • the house is very quiet
  • i can work partially naked
  • i can curse quietly – which is midly therapeutic
  • problem solving is prolonged
  • late night snacks

My advice to anyone out there is start the day earlier! Get up an hour earlier than you usually do and convert from the late night, bleary eyed, workaholic to a fresh breathed, energetic, disciplined go getter. Anyone who knows me reading this post will call me a hypocrite but it’s nice to at least know what I should be doing.

Get some me Cake! CakePHP rocks! I have read so many PHP frameworks discussions over the last 12 months that it is so hard to commit to anything anymore. I am proud to say that I chose CakePHP. It never fails to impress. I rediscovered baking, the schema tool and migrations thank to Leigh Mac @ phpvideotutorials.com What an amazing feature! I have been writing something very similar at work and to discover this native to Cake only cements my respect for the Cake devs and all those who champion it’s cause. I’ve never used CodeIgnitor of Symphony so can’t comment. I am happy with CakePHP, I love CakePHP. Next CakeFest I’m there!

Finally, developing my first fully fledged CakePHP WAPL app and it is so easy and fast to develop and deploy that when you see the results on the phone you can’t fail to be impressed. Great work the guys at Wapple - even if am one of them! Check out the Mobile WordPress Plugin and WAPL

→ 1 CommentTags:·····

Free CakePHP E-Book – Super Awesome Advanced CakePHP Tips

June 8th, 2009 · Web Dev

Been a while since I blogged…

Just been googling ‘CakePHP’ to try and find out how many developers use CakePHP or how many times the framework has been downloaded. If anyone knows, please let me know.

Found this great FREE E-Book “Super Awesome Advanced CakePHP Tips” by Matt Curry:

http://www.pseudocoder.com/archives/2009/05/13/free-cakephp-e-book-super-awesome-advanced-cakephp-tips/

Plus this great book: “Refactoring Legacy Applications Using CakePHP” http://littlehart.net/book/

Go have a read and them the authors know what you think.

→ No CommentsTags:

Idea! Mobile Web User Registration System

May 20th, 2009 · Web Dev

I’ve been browsing the web looking for some inspiration for my Rails app. A very common aspect of most dynamic database driven websites is the ability to register a user and have a login system. This is a relatively easy task using a framework such as CakePHP, Rails etc. In the past, I haven’t used frameworks and it’s still easy with the correct approach.

Something I have picked up on is that when developers approach this subject on the mobile web there are lots of discussions and ideas, but seldom a successful solution that works on all mobile devices.

The key differeniator with Wapple Architect is that it plugs into an MVC framework so well and renders your existing app to any mobile device. The need for a developer to know device specifications is removed, so that developers can concentrate on the delivering functionality, business logic and the best mobile user experience. Wapple Architect does the hard part.

I recently came across a great article by Gordon Pettey http://bakery.cakephp.org/articles/view/universal-mobilization-with-wapl that demonstrates the MVC approach to integrating Wapple Architect into CakePHP and it is easy!

So… i’ve tasked myself with learning Ruby on Rails and have been playing around with a couple of ideas for a prototype. It seems obvious to me that a simple user authentication system that works on the web and the mobile web would be a great asset to the mobile web development community.

Watch this space!

Other great resources:

Wapl.info

Mobilize your cake app in minutes

→ No CommentsTags:····