!

I’m a freelance web developer, specializing in Ruby on Rails, currently in Lawrence, KS. You can see examples of my work at redlists or on github. You can hire me by sending me an email.

September 25 @ 07:21 AM | 0 Comments
October 20

RedMinutes Postmortem

This past weekend Ross and I participated in Rails Rumble.

“The Rails Rumble is a 48 hour web application development competition. As a contestant, you get one weekend to design, develop, and deploy the best web property that you can, using the awesome power of Ruby on Rails.”

I’m really excited about the site we launched, RedMinutes. We built RedMinutes for sharing meeting notes, but it can be used for any type of text. It splits the text up into sections based on Textile formatting. It should really make project planning easier.

I decided to use this opportunity to play with some stuff I don’t normally use such as Haml and JQuery. I really enjoyed using both of these, but, due to the time constraint, we didn’t really use them how they’re meant to be used. We kept all of the erb scaffolding and only other pages were done in Haml.

I really enjoyed how the design of this changed over the weekend. When we started, Ross and I had similar thoughts on what the app would do, but different thoughts on how it would work. Ross wanted more of a pastie while I wanted more of a writeboard so we had to make quick decisions on how certain things would function. My favorite part of the site’s visual design is the random colors around the forms; it’s a nice tie-in to the different section colors.

I encourage you to try out RedMinutes and, if you like it, vote for it. Make sure you check out a full list of all the awesome Rails Rumble projects on the home page in the next few days.

03:21 PM | 0 Comments | Tags: , , ,
October 13

rbVimeo 0.2.0

I just pushed version 0.2.0 of my rbVimeo gem out to Rubyforge. If you are using rbVimeo, you shouldn’t have to change anything. I only touched the internals in order to speed things up a little. I switched the xml parsing to Hpricot and I included lazy loading for comments (which require parsing an extra xml file) so that it doesn’t populate this every time you load a video.

Since I get a lot of hits to my blog from people searching for rbVimeo, I figured I should at least give them some information on how to use it. It’s a fairly simple library, since all it does is fetch public videos from Vimeo.

You initialize the gem by creating a Vimeo object:

vimeo = RBVIMEO::Vimeo.new(api_key, api_signature)

And you can load a video using the video’s id (the last part of a video’s url):

video = vimeo.video(video_id)

You can then load any information given by the Vimeo API. See the docs for the full list:

video.title
video.caption
video.comments # Returns an array of comment objects
video.likes
video.plays

If you are using rbVimeo from a Rails application, you can embed it through the embed function:

video.embed

If you want to contribute to the project, just fork it from github and send a pull request.

01:23 PM | 2 Comments | Tags: , ,
September 8

Test Driven Development with cplusplus

I’m currently taking a college course that uses C++. Whenever I develop anything in C++, I miss the file generation from Rails. In order to remedy this, I’ve created some generators using Rubigen. My first chance to use this was at my first lab, and it was the perfect opportunity to try out TDD with cppunit.

Prerequisites: Ruby and Rake are needed to run the generators and tasks. In order to use the tests, you need to have cppunit built. Install the cplusplus gem:

sudo gem install cplusplus

Task: Program a recursive function for determining string length.

First, we need to start the project:

  cplusplus string

This creates the basic project directory and the main file. Next we need to add the file to hold the string functions:
  script/generate file string

This command adds the files src/string.cpp, src/string.h and test/test_string.cpp

If we run the

rake test
command, we can see that the current tests pass
  Teststring::test_string : OK

Let’s start with the length function. We can replace the current test with our new test, since the current test only asserts that true is true. Change

CPPUNIT_TEST(test_string);

to
CPPUNIT_TEST(test_str_length);

and modify the test function
void test_string(void) { true; }

to
void test_str_length(void) {CPPUNIT_ASSERT(str_length("elephant") == 8);}

Run the tests and you’ll see
error: ‘str_length’ was not declared in this scope
Let’s go ahead and remedy that by declaring the function in the string.h header
int str_length(char *string);

and a basic version in string.cpp
int str_length(char *string) {
  return 0;
}

Now, when we run the test, we see that it fails:

Teststring::test_str_length : assertion
Let’s go ahead and fix the function so that it passes.
int str_length(char *string) {
	if(*string == \0) {
		return 0;
	}
  return str_length(string1) 1;
}

Rerun the test and ensure that it passes

Teststring::test_str_length : OK

This example was taken from part of my Programming II lab, which you can find the source of here.

Note: I am not a C++ expert or a cppunit expert. If you seen any way that I can make the gem better, don’t hesitate to tell me or to submit some changes via github.

10:46 AM | 0 Comments | Tags: , ,
July 27

Feather Releases

In the past few days, I have released a couple of new feathers; Code and Project. These are the features I really want in a blog and, since I haven’t been able to find anything that fit the bill, I created them like any self respecting programmer.

You can see an example of the Code feather here.
I don’t currently have an example of the Project feather, because I’m waiting on an update to the Categorize module.

I have also added a feature to the code feather to embed gists. using [gist: 2727] as seen in this post.

You can get the source to the Code and the Project feathers at github

12:05 AM | 0 Comments | Tags:
Next → Page 1 of 2