So I’m all upgraded onto the new Snow Leopard and I wanted to see what ZendServer CE was all about.  Well, unfortunately, when I try to run it, I see watchdog errors when I try to start the Java Bridge and Lighttpd.  Some have updated the lighttpd service script to not use watchdog (which still hoses the JavaBridge), while others tried to create a new zend user.  What worked for me was to replace the watchdog application.  After doing that, everything worked fine and I didn’t have to modify the lighttpd script or create a zend user.

Now that I have that done, I get to play around to see what all the buzz is about.

I am a vim user.  The thing I like about vim is it’s speed, how universal it is, and it’s customizations.  These customizations can come in the form of plugins, syntax files, compilers, and code completion utilities; all of which are scripts.  Scripts can be a single file like MiniBufExplorer or can encompass multple files like vjde.

Single file scripts are fairly easy to manage.  If you notice a new version of your script is released, then simply replace your file with the new version.  Likewise, it’s very easy to remove the script if you want to just try it out.  However, scripts spanning multiple files are much harder to manage.  For one, the script’s files get merged in with all of your other script files.

To help know what files are apart of what plugin, I manage my vim scripts in git.  Another way to keep track of things is to use a vimball.

What Are Vimballs?

Vimballs are essential vim script installers.  Each vimball contains all of the files that are needed for the script to work.  Not only that, but it also has a hook for you to easily uninstall the script as well.

Tail Bundle is a script that mimics tail -f for vim.  The downloadable artifact is a vba file.  That file is the vimball.  To actually install the file:

  1. vim tail-03.vba
  2. :so %
  3. :q

So what that all means is that you’re opening the vimball in vim.  From there, you’re executing the instructions that are in the file.  Lastly, you’re just quitting.  You see, a vimball is a vim script in of itself.  So executing it writes everything out to where it’s supposed to go.

While the tail bundle makes use of the vimball, not every script does.  Luckily, it’s easy to make vimballs out of most script downloads.
Read the rest of this entry »

I use iTunes for managing my music, mostly because I have to or my iPod and iPhone don’t place nice.  One of my favorite features is the smart playlists.  So when I want a play list of cover songs, I don’t manually create a playlist, I use this feature to create the playlist for me.

Read the rest of this entry »

So maybe not totally useless certainly fun. Normally, ruby scripts are finished when you reach the end of a file; however, this is not always the case. You can end your script sooner by using the __END__ keyword in your script. Once added, everything you type after that will not be parsed by ruby.

So what?

Well, you can use the global variable DATA to get the contents of what you wrote after the __END__ block. DATA is actually a File object to just that piece of text in your script.

Read the rest of this entry »

I’m playing around with merb so I’m using merb-gen to create some basic scaffolding; however, I’m not using ERB, the default rendering engine, I want to use haml

Haml comes with a script, html2haml, which can take HTML with ERB and convert it nicely to haml. Seeing as I would have to run that command more than once, I have a little command snippet that I like to use to aid with the conversion.

$ find . -name '*erb' | \
xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}'

That will print out what the html2haml commands would be, it does *not* run the command. I do that step such that I can review what will be converted. If I like what’s going to be done, then I just run that command and pipe it into bash…like so

$ find . -name '*erb' | \
xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}' | \
bash

If you like it, it probably wouldn’t hurt storing that as a shell script somewhere :)

Code Reviews are common in software development. One programmer reviews another’s code to find potential issues or to see if the developer could have used something that the system already provided.

With multiple programmers, you can probably expect a versioning system, perhaps a centralized versioning system like SVN or Perforce. With that system, each programmer would make his/her changes and then would check in his/her changes into the repository. From there, the programmer’s peers would review the code.

What’s the problem with this system? The code is already checked in. The pressure is on the peers to ensure that the code is good, and it’s likely that this could slip through the cracks. I mean, those peers are working on getting 10 features complete themselves.

Enter Git

Well, I would argue that Git has a strong code review process built right in. This is due to the process of how distributed version control works.

Read the rest of this entry »

So not only is git useful for the small projects it’s also good for keeping track of todos and issues. Ticgit is a distributed ticketing systems based on git. It provides a command line interface as well as a web interface via sinatra and stores all of the ticket info in a separate branch, called ticgit. Rather clever I think.

Read the rest of this entry »

We know that when you are working with a bunch of developers for code that’s going to be deployed to the world that version control is something that you want in your toolbox. I would like to submit that it’s not the only reason to use source control.

I bought a Flex book to, well, teach myself Flex. The book right now is taking me though one application and is building it out piece by piece. So I began to think: “What if I just keep track of all my changes through git?”

For one, Flex is nice because it’s all XML, so that makes revision tracking fairly easy. Also, git is very easy to get started because you don’t have to do any server setup. Just issue a git init command and get going. Then after each chapter, I can tag the repository for posterity’s sake. And I have to say, it’s been great to see how the code has changes, especially since Flex Builder generates code.

That’s one thing I love about git, and mercurial, it’s so easy to start using version control for even the littlest of tasks.

Usually one of the first things I read about on how to speed up ActiveRecord is to index my columns to speed up the lookup of items. “Of course!” But could indexing too much be harmful

Essentially, if your column is an enum, then indexing it could actually cause MySQL to do more work. Why? Because the data set is so large, the MySQL ends up doing a full scan. So things like keeping track if something is active (1 or 0) then you can expect indexing to hurt.

So how does this effect ActiveRecord? Well, if you’re keeping track of whether a user is active or not you would not want to index that column alone. Nor would you want to index a type column if you were using single table inheritance, again, because there isn’t a lot of variance in the type.

So make sure that you index the right things, like IDs and leave the enum-like columns alone.

So there I am, wanting to install Photoshop on my laptop, which happens be a Mac with Leopard installed when I see this lovely message:

System Requirements Error

Read the rest of this entry »