How to add JavaFX to SyntaxHighlighter

I got sick and tired of my JavaFX code not having proper syntax highlighting on my blog and in my presentations, so I extended SyntaxHighlighter to do just that.

How to implement it

First, you’ll want to download SyntaxHighlighter or get the Wordpress plugin (and make a donation, it really is a cool piece of work). Next, unzip or otherwise install it. Download my shBrushJavaFX.js and copy it to <install_directory>/scripts Continue reading

Programming lamentations to learn from

I was reflecting on some of the things I’ve experienced while in the software engineering field. There are some big mistakes I’ve witnessed and made. I’m going to share what they were and I hope you gain insights of how to approach some situations… especially if you are new to the industry.

Clever code

During my first job, I was helping to write a generic report builder application. We needed a method to parse a Date out of an oddly formatted string. Being fresh out of college, I was excited to show that I could write something that would parse immensely fast — and I did. There was one major problem, no one else understood it. When it came time to refactor, a senior engineer said this to me and I’ll never forget it:

Programming languages are designed to be understood by humans.

If your code is good enough to stick around it will have to be maintained and probably by someone else. There are exceptional cases of course, but remember that compilers often make the same optimizations (or better) than the ones you cleverly devised. Learn from my mistake, don’t be clever. Continue reading

Crush images on the command-line with Groovy

One of the ways to speed up your site and save bandwidth is to optimize your images. You can often halve an image’s size without losing (much) quality. Many photo editors may give you this option, but it’s a slow manual process. What we really need is a way to automate this so that every time we deploy changes we can optimize in one step.

Getting Started

You’ll need 2 tools (and Cygwin if you’re on Windows) to pull this off:

Continue reading