Author Archives: joe

About joe

.NET developer and board game geek located in the greater Atlanta region.

Ruby Clipboard Directory List Utility

I wrote this little script to copy the filenames of a directory into the clipboard a while back and forgot to post about it. I’ve been particularly surprised about how often it’s come in handy for this or that.

 require 'clipboard'

c = Clipboard.new

list = ''

if ARGV.size == 0
	path =  "."
else
	path = ARGV[0]
end

Dir.foreach(path) {
	|file|
	if(file.length > 2)
		list << file << "n"
	end
}

c.set_data list

To use it, simply call run the script with the directory you want copied to your clipboard as an argument!

Download the code!

Target Practice Pt 2

I made a few small updates to Target Practice tonight. The biggest addition was sound although I made a few other little tweaks under the proverbial hood.

I had originally wanted to pack it up and release it as a single executable file but I was having some issues which I’ll post about once I figure out what the heck I’m doing.

Speaking of lazing, there are a few things I’d like to do differently in Target Practice. Most notably I’d like to abstract out out the media to some manager or another, and also my target manager class has grown rather bloated which I take to be a good indicator that it’s doing more than it should. I don’t care enough about this program to fix either of these issues, but hopefully I’ve learned from these mistakes!

Download it!

CFEclipse/Ganymede Line Number Problem

My tray line numbers weren’t showing up in CFEclipse since upgrading to the Ganymede version of eclipse. My preferences were set correctly. I did a bit of googling but I didn’t actually find the solution until a few links down, so I thought I’d share the link love!

http://blog.critical-web.com/blog/index.cfm/2008/8/3/Enabling-Line-Numbers-In-CFEclipse-1316-On-Eclipse-Ganymede-34

1. In directory
[workspace]/.metadata/.plugins/.org.eclipse.core.runtime/.settings/

2. Edit (or create) a text file called
.org.cfeclipse.cfml.pref

3. Add the following line:
lineNumberRuler=true

4. Restart Eclipse

How to Recover a Deleted File in Eclipse

I don’t know how (yet) and I can’t recreate it, but I swear that Eclipse ate two of my files while in the CFEclipse perspective. Neither of which I had placed under version-control yet. (DOH!) I was able to recover one of them from a nightly back-up.

When trying to figure out exactly what the heck happened, I took a peek at the local history for my back-up file and Eclipse still had the record of my changes up to the moment I lost the file!

Sooooo I re-created my lost file, right-clicked “Compare With” and “Local History” and I was able to re-cover the latest version of my file!

Phew!

Target Practice

Half-Life is the game of choice at work, and sadly I’m terrible at it. I thought I’d try to write a little game using gosu to try and help me improve my accuracy. I just reached a good stopping point and I thought I’d share.

It’s really simple, the idea is to shoot little 20 x 20 “targets” (I’m artistically challenged) before they expire. Missing or letting 10 targets expire will end the game. Next version will include sound, improved visuals and maybe even a couple other fun features if your lucky.

The code is a bit over-engineered but I plan on incorporating parts into some “core extensions” that I’m working on that will hopefully make it a lot easier for me to bang stuff like this out. Finally, as I doubt anyone will ever download this, I didn’t bother to pack it up so you’ll have to have Ruby and gosu installed in order to enjoy it.

Download the code!

PS: I’ve been a Photoshop user for many years, but I used GIMP to make these images and I didn’t even hate it!