## Developer advice

As the organizer of the SoFloPHP User Group I am often approached by entry to mid-level developers asking what they can do to advance in their career or become better developers.  Of course I am nowhere near perfect but have been around long enough to get a few bumps and bruises along the way, so below is what I usually share as some pointers:

Note: While some of these items are kind of PHP specific, others may find useful items as well.

• No self-respecting person should be up at 4:05am sending emails.  Get some sleep. 🙂  It is OK to stay up late once in awhile, but force yourself to get to bed at a decent time (10) each day.  And try to get up early each day also (6 or 7), which will help you get much more out of your days. 😉
• The myths about developers working all night on caffeine are false.  Yes, it happens sometimes, but it is rare.  Well rested developers learn more, write better code, and get more work done…period!
• Track your time, and get in the habit of knowing what you did with each hour.  I personally use Hamster religiously, and find that I get much more done each day as a result. (I have it set to nag me every 15 minutes if I have not set an activity.)  If you are not using Linux as your desktop environment I am sure there are time trackers for the other operating systems, find one.
• Certifications will not actually carry much value on your resume, so I would not make them a main focus.  Sure they do carry some value, but perhaps not in the way you desire.  Achieving a certification is a great personal accomplishment and will make you feel better about yourself, as well as give you bragging rights among developers.  (Most developers tell you they don’t care about certifications, but deep inside they are simply envious.)  While many certifications are not a true gauge of actual knowledge, they do represent a certain amount of skills.  However, I have found that most employers do not even notice certifications.  I am not saying don’t get them. What I am saying is to be aware the actual accomplishment may be different than you perceive.  When I started getting certifications it reinforced, in my own mind, that I knew what I was doing.  That gave me more confidence overall in my jobs, and was still a big “win”.  But do them in your spare time, not as a focus item.
• Pick an IDE to use and learn it FULLY. I will not recommend one in this post, so explore and find one that fits how you want to work.  Then learn it COMPLETELY, and use it ALWAYS.
• If an IDE causes you pain, don’t use it any more.  Pick another one.  This tool will be where you spend most of your day, so you should not be forced to spend your time debugging and fixing your IDE.  It should not crash regularly.  You should not dread opening it, instead you should look forward to launching it.
• Use all parts of your chosen IDE. (FTP, version control, testing, coding, debugging, issue tracking, etc.)
• Learn the keyboard shortcuts, they will save you time.

### Via GUI:

Open the System Settings and click on the Software & Updates icon, or using the Dash you can simply type “Software & Updates”.  Once it opens you can select the “Other Software” tab and check the first box titled Canonical Partners.

Now we are able to install Skype from the Canonical Partners repository no matter what method you wish to use.

### Install Methods:

From terminal

sudo apt-get install skype

Or search for it through Ubuntu Software Center or Synaptic Package Manager and install nromally.

It will install some other required packages with it, but after the install it now works as expected with the indicator and all.

Enjoy!

## Executing CakePHP script using Windows Scheduled Task

In Windows adding a scheduled task is just not as straight forward as adding a CRON job using Linux. (Don’t get me started on troubleshooting a Windows Schedule Task that did not run for some reason.) However, it is not so difficult once you get it figured out. Here is what I did:

In this case I wanted to run a CakePHP script as a CRON job, or more accurately, as a Windows Scheduled Task since this customer insisted I create the application and use a Windows server. (I used XAMPP, so it wasn’t too bad.)

In order to run the script and take full advantage of the models in CakePHP it required that I use the CakePHP shell. Luckily the CakePHP developers created a ‘cake.bat’ script that enables this to happen on a Windows machine.  Normally on a Windows or Linux server you can navigate, via command line, to the ‘app’ folder and execute the ‘cake  name_of_script’ command, but using Windows Scheduled Tasks you need to execute the bat file.

Windows Scheduled Task Settings:
Run: C:\path\to\cake.bat  script_name {without the extension .php}
Start in: C:\path\to\app\folder
Run As: type in the appropriate users

Then of course you will need to go to the Schedule tab and set in the schedule you desire for your script.

Here is a screenshot: (you can see the default folders for xampp were used)

IMPORTANT: This entire process assumes that you have already created your script and placed it in the appropriate directory “/app/vendors/shells/{name_of_script.php}”.  It also assumes you understand how to create a cronjob for CakePHP to use.  (see below for a sample)

Sample content of ‘script_name.php’:

class ScriptNameShell extends Shell {   var $uses = array('model1','model2'); /** * the main function is kicked off like a contructor * */ function main() { echo 'Doing something.';$callingSomething = $this-&gt;otherFunction(); echo$callingSomething; }   function otherFunction() { $content = 'This is content from otherFunction.'; return$content; } }