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

Solarum’s Open Source Project – nix32

I thought I would post some information about a project that I started a few months ago called nix32.  It’s hosted on SourceForge for the most part, with a handy website that I host myself mainly because it’s just easier to manage that way.  The basic goal of this project is to create native command line tools for Windows that operate much like the commands that we know and love from Linux and UNIX.  Things like ls, mv, cp, df and so on.  I have become so used to, comfortable with and productive with the UNIX/Linux command line environment, that when I have to leave it behind on Windows, it’s pretty tough.  Not just changing from what I am used to, but also because I think the command line of a UNIX/Linux server is much more powerful and flexible than the Windows command line, even including the power shell.

I have been working on the more popular commands, and I have a few basics out now with basic functionality.  I hope to have more and better (improved) tools in the future.  I am writing everything in PERL and then compiling each one on Windows as a standalone exe using tools from ActiveState, and so far, they run very nicely.  It’s all completely open source, you can download the PERL scripts as well as the executable files if you want to take a look or help improve them.

Now, I know you can get similar results with other projects and products out there, CYGWIN comes to mind first.  However, that’s a whole separate shell and almost a little mini-Linux setup in and of itself, especially looking at the directory structure after it’s installed.  Here with the nix32 project I wanted to have native Windows executables that you can stick in your path somewhere and call right from the Windows Command Prompt, without ever leaving the Windows environment and without having to install anything.  So far that is exactly what we have, just copy the files somewhere, make sure it’s within or added to your PATH variable, and you are good to go!

So check it out, see what you think, spread the word and maybe even help out a bit and crunch a little code too.  Do whatever you feel and keep both feet on the wheel … or, keyboard maybe.  🙂

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

PERL Tip For Data In Arrays

Recently I was working on a script for log reporting.  You know, one of those handy little guys that send you some info every day helping to make sure you keep up with whatever it is that you don’t want to forget about.  Well, some of the data was in a plain old text file, and there is nothing wrong with that.  It’s easy to simply cat the file and pipe it through mailx or mutt, no fuss, no muss.

Continue reading

Generate Random Unique Number

I have found many times when writing stuff in PHP that I have come across a need to generate a random number. That’s not too bad in and of itself, but what about when you need a unique ID key or something like that. For example, say you are writing the next best helpdesk application and need unique case numbers and don’t want to simply use a counter. For whatever reason, I put this little function together and it has served me well. Check it out …

Continue reading