Komodo IDE Snippet Variables

Here we go, for anyone out there using Komodo IDE (and maybe Komodo Edit, not sure if this is available in the free version).  Aside from being the coolest and best IDE I have found for editing PHP, PERL, SHELL and other scripts, the environment itself has lots of features.  One cool thing is that you can create “snippets”, which are text files that you can insert into your code files with one click or assignable hot keys.  When you create these snippets you can use variables to add to their functionality.  Some variables get substituted with information at the time you submit them, and some will ask you for information so you can tailor your snippets to suit whatever need you have.  Listed at the end of this post are the variables available for use in snippets, sometimes it’s hard to find them, so I thought I would post them all here.  All snippets aside, I highly recommend that any developer out there working with the earlier mentioned PHP, PERL, and the like, go check out Komodo.  You can start out with the free version, Komodo Edit and see what you think.  Remember, I don’t get paid to tell you that, I am just a very happy user of the product and recommend it to anyone who needs something along those lines.

[[%f]]: file base name
[[%F]]: file path
[[%d]]: directory base name of file
[[%D]]: directory path of file
[[%P]]: path of the active project
[[%p]]: directory path of the active project
[[%L]]: current line number
[[%s]]: selection
[[%S]]: URL-escaped selection
[[%w]]: selection of word under cursor
[[%W]]: URL-escaped selection or word under cursor
[[%guid]]: A new GUID
[[%date]]: Current date
[[%ask]]: Ask when snippet is inserted

Awesome Source Code Library

(Click to enlarge)

OK, boys and girls, I have a really cool treat for you.  For a long time now I have been looking for the right application to use as a source code library.  I say application because I have been trying to be open minded about what to use.  I have tried Wiki’s (which actually aren’t too bad), note taking programs, and a great many other tools, including a couple that were specifically written to be source code libraries … but in the end fell quite short of my expectations.  Also, when I say source code library, I am not and have not been looking for tons of canned code to take advantage of, that’s the problem I have now, 20+ years in IT and I already have tons of code, I just need a way to store it, sort it, search it, export it, back it up, and anything else I can think of!  I’d like to note too that in addition to all of the other features I may list here, this tool does a superb job at syntax highlighting as well.

Let me digress for a moment to mention a site called Donation Coder (www.donationcoder.com), these guys are great!  Lots of free software from some really talented developers.  There are some apps there that beat their commercial competition by a country mile, hands down.  That’s one reason why I like to hang out there, in the forums for example, these guys write software because they enjoy writing software.  Therefore they create some wicked cool stuff.

How does this pertain to the issue at hand?  Well, it was in the forums there that I ran across a thread where people were talking about their own search for a source code library much like my own search.  I found one post among others recommending different things that mentioned a free tool called “Developer’s Tips & Tricks (DTT)” from Freesoftland.  I had never heard of this group before, but I liked what I had seen posted in the Donation Coder forums, plus I really liked what I saw when reading up on their DTT tool.

Continue reading

Installing a LAMP Stack on Ubuntu

I am using Ubuntu (Hardy Heron) as my primary desktop OS, and I wanted to install some tools for doing development work. At the same time, I thought I might run through the steps and post them for anyone else that might be looking to do the same thing. I’ll walk you through what I am doing, it’s your typical Linux Apache MySQL PHP (LAMP) stack.

First off, you can use sudo to run these install commands as your own local user, by putting sudo before each command, but I find it easier and more concise to simply use sudo to become root and install that way. I will write this article from that perspective, so if you don’t want to do this as root, simply put sudo before each command here.

You can become root by using this command from a terminal session:

sudo su -

Now that we are root, let us install MySQL which will be our database server:

apt-get install mysql-server

Next, let’s install Apache for our web server:

apt-get install apache2

In my case, I am developing in PHP, so we need to install PHP for Apache:

apt-get install php5 libapache2-mod-php5

Last but not least, if you want a nice database manager, get phpMyAdmin:

apt-get install phpmyadmin

If this is not a box that you have KVM (Keyboard, Video, Mouse) access to, and you will be connecting remotely, you will need to install the OpenSSH server so you can ssh into the server. Do this like so:

apt-get install openssh-server

Once installed, you should be able to log into the server with your user account. Please note that by default, you cannot log in as root via ssh. There you have it, now start writing some cool code!

Great stuff at PortableApps

In this post, I’d like to do two things.  First off, I want to plug a really cool site called PortableApps.com that has some really cool software in the form of … well, portable apps.  What these are, are common widely used applications that have been transformed in such a way that they can run right off of your thumb drive, no install necessary, hence the term portable.  They have lots of cool stuff that you can download, absolutely free, and use right off your thumb drive, or hard drive, or anywhere really.  It’s nice being able to have firefox and open office (and much more) with you, no matter where you go, even with all of your own settings and customizations.  That’s hard to beat!  Go check it out, you won’t be disappointed I am sure. Continue reading

MySQL Error Handler For PHP

Anyone that works with MySQL and PHP knows that it’s a good idea to trap and handle errors as a part of making calls to the database. I have seen folk that do it in many different ways, and some that don’t do it at all. It’s a real handy thing to do, especially in the early phases of development. If there is a problem somewhere in your code, good feedback from the application can make troubleshooting much easier. I tend to write functions that make life easier, put them all into a file and then reference that from my pages that actually do the work. In this case, I have a function that will catch and return MySQL errors, along with the query so you can see what is going wrong. First I will show you the function, and then I will show you some usage examples.

Continue reading