“Introduction to Ruby” talk from Twin Cities Code Camp 7

Posted by Brian in News, Projects (October 25th, 2009)

On Saturday, I had the honor of giving a talk on the Ruby programming language to an exceptional audience. I talked about the simple syntax and powerful libraries available, and then showed how we can use Ruby to maintain static web sites, build web applications, and test web sites.

During the talk, I showed how to use Sinatra to create a very simple wiki. I wrote two versions. During the talk, I used SQLite3 and ActiveRecord, but I wrote a version that uses MongoDB. You can grab the source for those at Github.

Here are the slides from my talk. You can view the notes too by viewing the slides on Slideshare.

Participating at code camps is something I really enjoy. It gives me a chance to talk about what I love, but it also gives me a chance to learn from other speakers. These events are usually free, and an awful lot of fun.

lazy_developer gets some TLC

Posted by Brian in News, Projects, Rails (June 10th, 2009)

lazy_developer is a Ruby on Rails plugin I use on a lot of my projects to make my life easier as a developer. It’s a collection of Rake tasks that automate some common operations. Some of the more interesting features it provides are

  • the ability to dump a database to YAML format and then pull it back in again
  • a simple way to obliterate models, controllers, views, helpers, and related files easily (in the case of a refactor or a fat-fingered typo
  • a method to compact your migrations into a single migration file
  • and of course, automatically clone your test database whenever you migrate

Today, Kevin Gisi and I gave this plugin some much-needed love and attention after we discovered a few problems. Here’s what’s new:

Data exporting works with Rails versions prior to 2.0

Got an old database you’d like to pull in? This now works in Rails 1.2.3!

Data dumping works much better now!

We noticed some duplicate records sneaking into the output files, and it was due to a mistake I made when I implemented my own version of record pagination. It wasn’t limiting correctly, and Kevin quickly spotted the reason why. It also wasn’t storing records in the YAML file properly either, which I also resolved.

This is tested on Microsoft SQL Server, MySQL, and SQLite3.

Migration compacting works now

This was patched a few days ago and merged in, but I flip-flopped a couple of lines during a merge and it made it into the master branch that way. Kevin decided he’d like support for Subversion for this, so he added it. I’ll add in Git support very soon.

Interested in using this on your projects? Go get lazy_developer right now!

Bob Martin – What Killed Smalltalk Can Kill Ruby Too

Posted by Brian in Projects, Rails, Testing (May 7th, 2009)

I had the extreme pleasure to watch Bob Martin talk at RailsConf. He is an amazing speaker for more than just his delivery style (which is amazing). He’s incredibly bright, and has a wealth of experience that everyone can learn from. The majority of his talk was focused on acting professionally, and his definition of professionalism means, specifically, writing tests for every line of code in your application.

I can’t agree with this more. Without a robust test suite, your application is garbage. As Bob said in his talk, without tests you will be afraid to change your coe because it will break and you’ll have to spend hours finding out why. When you have tests, making changes is much easier because you no longer have fear.

If you have applications without tests, write them. Follow Bob Martin’s rule – “Check the code back in a little cleaner than you found it.” If you don’t know how, let me know. I offer effective one-on-one or group virtual training sessions.

If you are writing applications for clients, you need to test your code. If you’re working with a development firm, you should ask them how they test the code you pay them to write. Professional developers write tests and can then respond quickly to changes. Amateurs just hack things together, and then charge you hourly to fix their mistakes.

RailsConfigModel updated

Posted by Brian in News, Projects, Rails (April 22nd, 2009)

The Rails Config Model gem makes it extremely easy to create a “settings” table in your application. It creates a configuration controller and model that can be used to quickly create configuration table for your system so you can store system-wide variables that you’d like the site administrator to be able to set.

You can see instructions on usage or contribute to the project.

LazyDeveloper update

Posted by Brian in News, Projects, Rails (April 22nd, 2009)

For those unfamiliar, LazyDeveloper is a Rails plugin that provides tasks to simplify some cumbersome development tasks. I find it to be an indispensable tool. The latest version (1.1.4) fixes a couple of bugs related to running tests, and introduces a couple of new features which you can read about at the project page.

This is the last release of the plugin. I’ve decided to move this to a gem instead.

If you’re interested in contributing, feel free to fork the project and send pull requests!

Twin Cities Code Camp VI: Shoes!

Posted by Brian in News, Projects (April 11th, 2009)

I had a great time talking about building applications with Shoes, which is an amazing Ruby-based GUI framework originally aimed at kids but awesome for grownups too. The source code for the examples covered in the talk is available at http://github.com/napcs/shoes_demo_apps/.

Slides coming very soon.

“Web Design for Developers” now available in Beta

Posted by Brian in News, Products, Projects, Usability, web (November 19th, 2008)

Web Design for Developers

My book Web Design for Developers is now available in Beta form.

You’ll learn how to design a web site from start to finish, and you’ll use many of the techniques and thought processes you’ve come to rely on as an application developer. You’ll learn some color theory, some typography basics, some XHTML and CSS, and how to incorporate Photoshop and Illustrator into a work flow that works for you, not against you.

You can buy an early copy and then contribute to the feedback cycle to help make this an even better book when it eventually ships. You can purchase the PDF and start reading now, or preorder the printed book which will ship after the beta process finishes up.

Rails for Windows Shortcut available now!

Posted by Brian in News, Projects, Rails (May 14th, 2007)

Rails for Windows Shortcut

If you’re looking to get started with Ruby on Rails and you’re a Windows user, this book will walk you through setting up some of the tools you’ll need, as well as show you how connect to Microsoft SQL Server and set up Capistrano. Of course, this is targeted at people who are new to Ruby on Rails and come from the Windows platform.

Curt Hibbs wrote the first chapter, where he showcases how to use RadRails and InstantRails to create a quick and easy setup.

The book covers

  • InstantRails and RadRails
  • Installation with the One Click Ruby Installer
  • Installing RMagick
  • Working with MySQL and SQL Server
  • Setting up a simple Subversion repository on Windows
  • Using SQLite and scaffold_resource to rapidly prototype a simple application
  • Using Capistrano
    … and more.

So check it out, won’t you?

Karaoke For A Cure

Posted by Brian in News, Projects (January 24th, 2007)

I’m proud to be sponsoring this year’s Karaoke For A Cure contest, a benefit for the Eau Claire American Cancer Society. We’re developing the web site and providing the domain and hosting this year. Visit the site here.