Projects In Sublime Text 2

In the past I’ve always been working on just one project so I have never explored ‘projects’ in Sublime Text 2.

Today I needed to work on multiple things so I broke down and discovered how projects work. Like everything else in Sublime they are very simple, and offer a lot of flexibility.
Continue reading

Posted in Code | Tagged , , | 1 Comment

Sublime Text 2 – Format SQL

I’ve posted before about formatting SQL in my IDE. I always inherit code where the previous developer formats their SQL different than I like. Currently I’m suffering from ALL CAPS SQL.

SELECT INT_SUB_ID FROM INT_SUBCATEGORY WHERE INT_CAT_ID = 123

My eyes! My eyes!

I immediately hit Package Control in Sublime and sure enough there is a SQL package: Format SQL.

After installing (and restarting Sublime) you have a new option under Selection. Format > Format SQL Statement.

This got the indention correct but I was looking for some case changes:

SELECT INT_SUB_ID
FROM INT_SUBCATEGORY
WHERE INT_CAT_ID = 123

Looking at the python-sqlparse library documentation there are some statements to change case for keywords and identifiers. So I cracked open \Sublime Text 2\Packages\Format SQL\FormatSQL.py and found this line:

return sqlparse.format(s, keyword_case="upper", reindent=True, indent_width=indent_size)

And modified it like so:

return sqlparse.format(s, keyword_case="upper", identifier_case="lower", reindent=True, indent_width=indent_size)

And now I get:

SELECT int_sub_id
FROM int_subcategory
WHERE int_cat_id = 123

Done!

Posted in Code | Tagged , | Leave a comment

cfObjective – Code Reviews

This will be my third time invited to speak at cfObjective and my second year presenting! (yeah, I know that doesn’t add up)

I’m excited to be presenting about code review.

In the past there were things the majority of developers didn’t do…

  1. Version control
  2. Unit / application testing

I think in the last few years the majority of people I’ve spoken to have adopted both of these. SVN/git and MXUnit have made these previously tedious chores almost enjoyable!

But if you mention code review most developers will either have no idea what you are talking about or shake their head in disgust while mumbling something about ‘waste of time’.

Code Reviews

Getting Started with Code Reviews

Code reviews have been shown to beat both unit and integration tests for finding bugs. So if you are already writing tests – why not do code reviews?

“I believe that peer code reviews are the single biggest thing you can do to improve your code.” ~Jeff Atwood (Coding Horror)

In my preso I’ll cover all the pros and cons (the pros hopefully will outweigh the cons) and show you how you can easily get started with code reviews.

cfObjective is the best ColdFusion conference north of the Mason Dixon line :) and is three days of great speakers, great content and great networking.

The schedule has been posted, and registration is open. See you there!

Posted in Code | Tagged | Leave a comment

mRemoteNG – Putty + RDP (and more) Connection Management

In my new job I’m accessing a lot of remote machines. Windows servers via Remote Desktop Protocol (RDP) and Linux / Unix servers via SSH.

I have both the Remote Desktop application and Putty available but managing all these connections is a bit tedious.

I did a bit of research and discovered mRemoteNG.

mRemoteNG is an open source, tabbed, multi-protocol, remote connections manager. It allows you to view all of your remote connections in a simple yet powerful tabbed interface.

It basically provides a single location to manage all those connections in one location. It provides a nice clean interface with tabs which I find very useful when connecting to multiple servers at the same time. In addition to RDP and SSH it supports the following protocols:

  • VNC (Virtual Network Computing)
  • ICA (Citrix Independent Computing Architecture)
  • Telnet (TELecommunication NETwork)
  • HTTP/HTTPS (Hypertext Transfer Protocol)
  • rlogin
  • Raw Socket Connections
mRemoteNg

mRemoteNg

Posted in Code | Tagged | 1 Comment

Ethervane Echo – Clipboard Manager

If you’ve come to one of my ‘tools’ presentations one thing I talk about is using a clipboard manager.

I use a lot of software from Donation Coder, including Find and Run Robot and Screenshot Captor. Recently in their newsletter they mentioned a new clipboard manager called Ethervane Echo. Intrigued, I’ve been using it for the last week or so…
Continue reading

Posted in Code | Tagged | 2 Comments

TODO Support In Sublime Text

One of the big things I was missing from Eclipse was TODO support in Sublime Text.

Now thanks to the awesome community of plugin authors this has been resolved. Check out SublimeTODO.

Extract TODO-type comments from open files and project folders

Continue reading

Posted in Code | Tagged , | Leave a comment

Sublime Text – Quick Indicator for Tabs vs. Spaces

I was running through some code today in JSHint and it was complaining about “Mixed spaces and tabs.”

What? I always use tabs so I was curious where the spaces where… Sure enough on looking there were spaces! Doh.

Then I noticed something in Sublime:

Sublime - Tabs and Spaces

Do you see it?

Before ‘displayStipulator’ there is ‘….—-’ and before ‘doChanged’ it’s ‘—-….’. When selecting text in Sublime the tabs ‘—-’ and spaces ‘….’ are highlighted for you!

Now that I know this is there I’ll be more aware and cleanup spaces when I see them!

Update: Digging through the preferences, there is an option for this:

// Set to "none" to turn off drawing white space, "selection" to draw only the
// white space within the selection, and "all" to draw all white space
"draw_white_space": "all",

Also note you can easily convert from one to the other via View > Indentation > Convert

Posted in Code | Tagged , | 3 Comments

Finally – Firebug Can Be Positioned On Any Side Of Browser Window

The latest Firebug (1.9b1) allows the Firebug pane to be positioned on any 4 sides of the browser (as well as detached)!

I have a widescreen monitor and have much more width than height real estate.

Install the latest beta, hit the Firebug menu and there is a new option: Firebug UI location (detached, top, bottom, right, left). I’ve moved mine to the left. I also selected Firebug > Options > Verical Panes.

Vertical Firebug

Vertical Firebug

Posted in Code | Tagged | 3 Comments