Easy SASS compilation in WebStorm / PhpStorm

If you are a regular reader, you might have noticed i have started using SASS a while go. If you are not, and don’t know what sass is, you can read my previous post on sass here.

Recently Webstorm/PhpStorm introduced the support for sass syntax highlighting, which is really awesome, but the compilation of SASS files is not integrated in the IDE.
There is however a way to set up Webstorm/PhpStorm to use external tools, which is perfect to make sass compilation from within the IDE possible.

Just follow the steps below, and you can enjoy the comfort of SASS compilation from within your favourite IDE.

Open the Settings panel: File > Settings

Then go to “External Tools” and click “Add…”

The following screen shows up, fill in the values you see (but point the “program” field to your sass installation path)

Now, right click on your SASS (or scss) file, and the sass tool will be right there, as you can see in the screen below.

Some additional useful tips:

  • Alternatively, if you prefer the one time compilation, or other sass parameters, just change the “parameters” field, or create some duplicates of this external tool setup.
  • If you work with “deploy to FTP” on save, make sure to enable the “Upload external changes” option.

My progress on the PHP on Azure project

Windows Azure LogoIt’s been a while since i’ve blogged about the PHP on Azure contest project. This post will be about the project, but not necessarily about my implementation of PHP on Azure.

As i wrote in my introductory post about the project, the main reason to participate in the contest is to put a lot of things i recently learned into practice. And so far so good.
My main focus is not to build a good application in general, but to me it is about discovering and experimenting on how to keep a PHP application and all that comes with it (search engine, multi media converter, database) as scalable as possible.

Before starting on the project i highly underestimated what is involved with building a highly scalable solution. It definitely involves more than just deploying a project on the Windows Azure platform.

This is also the main reason i haven’t blogged about PHP on Windows Azure that much yet. Since my main goal is to deploy everything on the Windows Azure platform (database, files, search engine and the application itself of course) i had a lot of stuff to look up and experiment, as i’ve never worded with IIS7 and MSSQL in combination with PHP before, leave alone with Windows Azure (or any other cloud platform).

Nevertheless, i really enjoy working on this project. As the deadline is about 1.5 months away from now, a lot of work can be done still.
More or less i feel i am at a point where i can focus my attention on building the application instead of looking up and experimenting on things (as much fun as it is, though).

In the (near) future i’ll write up some tips and tricks here on my blog, hoping to catch up on the bi-weekly blogging requirement for the contest ;-)
There’s a lot to share, i just haven’t put anything into practice yet, so it’s hard to blog about.

By the way, the other participants have shared some really interesting things about their project. You can read all their experiences on the PHP on Azure contest page.

Sass – Stylesheet tool

Sass logoNow this tool you are going to read about is nothing new. In fact, it’s been around since 2007 according to Wikipedia, but i have to share it with you because it will make your life easier!

“Syntactically Awesome Stylesheets” is what Sass stands for and is a tool to make several things related to writing and deploying stylesheets easier. It is a command line tool written in Ruby, and is available as a ruby gem.

For writing stylesheets Sass has a couple of (language)features. For instance it supports variables, calculations, includes and this thing they call ‘mixins’; some sort of templates or functions.

Sass or actually, since version 3 they call them .scss, files need to be converted to normal a CSS file so you can use it like any other CSS file in your browser. This conversion is being done by the command line tool.

One of the most interesting features of this tool is that you can tell sass in what format it needs to output the css format. It can render normal (extended) css, but also in a compact or compressed way.
This is useful when you have deployment scripts for different environments.
Also, while developing, don’t worry about having to run the command every time while: with the –watch switch sass will automatically watch your scss file for changes and render a new css file each time it’s saved.

I really like tools that are easy to use, require no configuration and require no alteration of my workflow process and Sass is definitely one of them!
If you want to learn more about Sass or want to start using it right away, check out their website!

PHP on Azure contest

Lately i have been learning a lot of new things like development techniques, best practices and design patterns. Now obviously the best way to make all this information persist in my head is to bring it into practice immediately!

To start doing this i’ve started contributing to open source software projects like the Zend Framework. And besides helping to improve the quality of the framework framework you’ll  automatically become part of a large worldwide community of developers. To talk and share ideas with developers all over the world is an experience on itself and very inspiring too.

So, about Windows Azure and the contest

Now two weeks ago i was at the PHPbenelux conference where Maarten Balliauw announced the PHP on Azure contest. At first, this contest didn’t really get my attention because i wasn’t aware of what all the cloud computing ‘hype’ is all about in the first place.

After reading about Windows Azure and the concept of cloud computing in general i was surprised by it’s simplicity. It sounds like something very complicated, but in fact, from a developer perspective it is not.

From my perception running applications on Windows Azure, or cloud platforms in general is a developers’ playground full of possibilities, how awesome is that?!
How close to reality my perception will be has yet to be seen though, because i’m participating on the contest!

About the project

The project i’ll be working on for this contest is one that i’ve been playing with in my mind for a while now. It is an online (collaborative) documentation publishing platform.
Now this is actually a pretty simple concept. It’s a platform where people can collaborate on an information collection. Whether it be an online book, reference guide, manual or what other type of information you want to present online.
The added value of when presenting information on the web is that you can add something very imporant to the content: metadata. This metadata can be anything, really. You can add or embed pictures, video’s, files and links. Or, to improve interaction even more it is possible to start discussions or share the information on social platforms.

Now you might associate this concept with Wikipedia, but in fact it is nothing like it.
I’ll list some of the features of my concept, and you’ll see why it is not to be compared with Wikipedia:

  • Each information collection (or project) is presented seperately. They are all seperate projects, like with books.
  • It is possible to use a traditional publishing workflow: Writer > Reviewer > Editor
  • Content version control might be implemented
  • The look-and-feel of every individual information collection (or project) can be altered. Consider each project a seperate website.

It is just an idea, yet

For now, all of the above are just ideas. During the development my idea of the concept might change and i have to see what is possible to develop before the contest deadline.
However to me this project is a great way to put all the new interesting things that i’ve learned in the past months into practice. And for some reason, the project being an entry for a contest makes it easier to motivate myself ;-)

I think the project is a perfect fit for a cloud platform like Azure. Because with applications that *could* have a lot of users, an unknown amount of content (both textual and binary) it is really awesome that you do not have to worry about scaling options, but just focus on the application itself: It actually makes designing the application easier from the ground up!

Development platform and software

One of the first things that really caught my attention about Windows Azure, is that it comes with it’s own local development environment. You can use this environment by installing the Windows Azure SDK. I will use this environment, along with IIS7, SQL Server Express 2008 R2 and PHP 5.3 to develop the application. As you might expect, the framework i’ll use for developing this project will be the Zend Framework.

I think this setup is the best way to deploy my project on the Windows Azure platform, and to make full use of all the components it offers.

Are you in?

So that describes my project for the contest. If you’re still reading this blog post it looks like you might be interested in taking a shot at the PHP on Azure contest as well.
If so, i would like to get in contact! Let’s share idea’s, approaches and practices about Windows Azure or PHP apps in the cloud in general. Post a link to your blog in the comments or find me on Twitter!

If you want to start right away, you can find more information about the contest, and you can start right away with these Windows Azure introductionary account offers.

Over the next couple of weeks i’ll be writing some more (technical) blogposts about the PHP on Azure contest. So if you’re interested, take a regular look on my weblog, subscribe to the RSS feed or follow me on Twitter!

Keep your mind fresh with stackoverflow.com

When you are programming on the same platform on a day-to-day basis it’s easy to get used to certain methodologies or approaches to the problems that are presented to you.

Except for being able to present a solution quickly, i think taking these approaches for granted is a bad habit.
As a developer, it is important to look at problems from different perspectives, come up with different solutions  and eventually pick a solution that fits best.

To keep your mind fresh and away from tunnelvision on your platform, take my advice to take a look at the questions at http://stackoverflow.com for 15 minutes every day, and answer them if you can.

Why? First of all you help others with your perspective on a problem. Second, and most profitable for yourself; it’s a great resource for seeing other perspectives on problems. If you look at other people’s solutions, you (hopefully) get a sense for approaching a problem from different perspectives by yourself.

I just started to look at the questions today, and provided some answers of which i thought were approperiate.
Some were, some were not. At least i learned from all of them. For example: i was making unjustified assumptions (doh!), was pointed at dependency injection (once again) and was shown a nice regex technique.

I learned a lot this evening,  and from now on, i’ll spend every evening on Stack Overflow for about 15-30 minutes!

Using a PHP IDE: The start of a journey

So this week i’ve started the epic journey of setting up an environment to make full use of an integrated development environment for PHP.

Now using version control, develop locally, debugging, auto code-completion etc. is something i’ve heard a lot of people talk about lately.
Not because it’s a hot-topic, but because it’s mandatory for every (PHP) developer that wants to make full use of his or hers creative mind. Yes that’s right, what i considered first to be “Overhead” like version control seems to be mandatory for making your life as a developer easier.

As my day to day job requires me to work with several developers directly on a FTP server, i was never able to use a PHP IDE to it’s full extent. Things like debugging, auto code completion, version merging do not seem to be possible with *any* PHP IDE when you work directly onto a FTP server. So this has to change. And besides, this leads to a lot of problems which i probably don’t even have to explain.

Now that i am becoming more interested in Open Source development i have to do some research on how to set this all up.
Which is exactly what i am going to do this weekend.

There are a couple of problems i ran into before even starting to set things up. I still have to think of a solution to these:

  • Database version control
  • Automatic deployment
  • Merging feature branches to the testing/staging/live branches

Probably how to handle database version control concerns me the most, have to read up on that a bit more.

PS: Any idea’s, tips or tricks are welcome, as i am fairly new to all of this!

Javascript beyond the browser

As a web developer, i am using javascript on a daily basis.
I use it to manipulate elements in the DOM, set css properties, animate objects, interact with user elements, etc. etc.
Now i can’t say that i’m a true javascript ninja, but let’s say javascript and i get along pretty well. I like writing javascript; it’s a flexible, easy to write language, and there are some excellent frameworks that makes life a whole lot easier. Especially when writing cross-browser compatible code.

All the above mentioned usage of javascript is from within the browser, on the client side.
About a couple of weeks, click-happy as i am with links on Twitter i stumbled upon this talk about Node.JS by Ryan Dahl on Ontwik (great website for technical screencasts!).

Now the first thing that got my attention was that Ryan was visibly nervous, and i wanted to see how he made it through the hour. But soon the contents of this talk became my main point of attention. It’s very interesting how Node.JS’ approach to I/O operations leads to high scalability in terms of concurrent users. Now if you are interested in Node.JS specifically, i would suggest viewing this talk, and i’m not going into details in this post.
(Although Node.JS is on my “things to write about” list)

A week or two after that, i was experimenting with PhoneGap, an “Open Source framework for building cross-platform mobile apps”. PhoneGap enables a developer to create mobile apps (for iOS, Android, Symbian, Windows Mobile, BlackBerry and Palm) using HTML, CSS and javascript.
Now the best thing is you can still use platform specific core features like camera, contacts, geolocation or network.

After playing around a bit i got this great idea about using my laptop’s browser, a Phonegap app and a Node.JS server app to link up my mobile phone with my laptop. This enables real-time interaction between the two (or three, or four, or five)!! Now how awesome is that?!

First off an Android app with PhoneGap would send data from the phone’s accelerometer using ajax (but streams are excellent for this purpose aswell) to a Node.JS server application.
The Node.JS app would then broadcast it to all browser clients,  who will then *do stuff* with the data received from the phone.
Eventually i got this communication between my mobile phone, server app and browser running in real-time, which is what it was all about. Pretty awesome!

Now both of these (at least to me) ‘new’ technologies put javascript in a whole different perspective for me. I already knew the javascript language, but didn’t realize it has a lot more potential than just manipulating the DOM.

The use of javascript outside the browser has been a trending topic for quite some time now, but i’ve always been a bit in doubt of how this would be a good addition to our current stack of of tools, and how it would make a developer’s life easier.
Node.JS and PhoneGap proved to be very easy to use, and opened a new perspective of interaction to me.

If you know how to write javascript, don’t limit yourself to the browser!

Use your calendar now, prioritize later!

Recently i found out something interesting about remembering and prioritizing things, thought i’d share:

Use your calender for everything you need to remember.

Whether you need to: write an e-mail, make a call, check up on something, make a report, have a discussion or even write a blog post. Regardless of priority, write it down in your calendar.

If you do, you can’t forget to do it. Simple as that.
Personally, i tend not to write down things that i don’t put high on my priority list.

If you write the item down in your calendar on a date in the future that the specific item *could* be relevant to your attention, you won’t forget it.

You can prioritize it later!

Starting to share

So, there we are. Yet again, starting a blog.

I’ll explain why:
Today i attended a great online webinar called Day Camp 4 Developers, organized by Cal Evans and Kathy Evans.

This webinar was all about getting serious about your career as a developer, both professionaly and passionately.
But also about getting involved in “the community”. @lornajane‘s talk about getting involved in Open Source, the talks about defining your career path and the great people in the IRC channel were great motivations to attend this webinar, and actually do something with it and (hopefully) get involved.

Over the couple of weeks i’ll make a list of some topics of what i think is interesting to write about, share and hopefully discuss. Stay tuned!