Cory O'Daniel – These are just words Software development, thoughts, and randomness

7Oct/110

Using devise’s scoped url helpers in Cucumber; new_registration_path, new_session_path

You can use devise's scoped url helpers from cucumber, but you have to use them by their real Url Helper method names:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module NavigationHelpers
  def path_to(page_name)
    case page_name
    when /the sign up page/
      # dont use the helper's helper
      # new_registration_path(:user)      
 
      # use the underlying url helper
      new_user_registration_path
    when /the sign in page/
      # dont use the helper's helper
      # new_session_path(:user)      
 
      # use the underlying url helper
      new_user_session_path
    else
      #...yada, yada

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

6Oct/110

Screen shots of Steve Jobs Homage Pages, and Smarmy comments.

This is just a few screen shots of some big software companies with homages on their home pages to Steve Jobs. These are listed from Classy to Least Classy.

Apple
Apple - Steve Jobs Homage
Well of course they have one.

Google
Google - Steve Jobs Homage
Despite the phone war, classy Google - Very classy.

Adobe
Adobe - Steve Jobs Homage
Bastard wouldn't let your crappy software on his iOS, but a little reminiscent photo. *Respect*

Microsoft
Microsoft - Steve Jobs Homage
"Steve Jobs is dead, btw do you have an XBox 360 yet? Apple never made a console - Just sayin'"

Dell
Dell - Steve Jobs Homage
"Who the fuck is Steve Jobs?" Michael Dell! *Tsk, tsk* That's just rude.

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

11Apr/110

Soft launch of Rebody (rebodyhq.com)

Ian Serlin and I have been working on kolaboratory's first official project for the past few months called Rebody.

Rebody is a fitness and health analytics and tracking platform. The goal is to help people lose weight like I did through setting short goals and focusing on your body's metrics so you can see what really works for you.

Beyond that Rebody will soon have a network of trusted and qualified personal trainers to look into your metrics and questions to help you determine how to "rebuild yourself", as well as a community of people sharing their results that you can browse for inspiration or to apply their methods to yourself.

We are in our soft launch right now accepting Alpha sign ups. For pre-registering you'll get the first three months for free and lock in at $9 a month for life (our competitors software starts around $25/mo).

I started my experiment today. 10% body fat here I come. Can I do it? You'll need to follow me on rebody to find out.

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

1Apr/111

Hulu’s April Fool’s Prank

If you haven't seen Hulu's April fool's prank, you are missing out.

hulu

I have to say, they had me at first, but if they really wanted to trick me they would have pretended to add some good content.

PWNED.

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Filed under: Random 1 Comment
28Feb/113

Four Hour Body PAGG Stack, Cheap & Reliable Vendor

There have been a lot of over-night PAGG Stack suppliers since the Four Hour Body came out. You can get all the components way cheaper if you buy them individually and you can also get them from a reputable supplier.

Here are the links to picking up all the components on BodyBuilding.com. Stop wasting extra money on the companies that "bundle" them for you.

If you really want to spend the extra money and get them bundled PAGGReview suggests Pareto Nutrition.

Get skinny my fatties, muah ha ha ha.

UPDATE:
I was out of town for a week. During that week I went off the Slow Carb diet and began eating 'normally'. For one week I ate carbs, and cheese, and milk. I also stuck to the PAGG protocol for that week. Note, I did not binge, I at normally. I'm home, just weighed in, and I'm the same weight as when I left. I know a week isn't a long experiment time, but it is still pretty interesting results.

Also, I've been doing the poor man's build your own PAGG for a month now. I'm officially going to try the Pareto Nutrition supplements. I've found that dealing with all the pills and my giant pill box is kind of a pain in the ass.

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Filed under: Random 3 Comments
16Feb/113

HamlburgerHelper sets the Table – Easily create and display standard tables in Rails

I create tables a lot in my back end for display information.

I posted a table display/create helper method on dzone that easy to use but has a ton of options.

This is the helper I currently use on my admin backend pages to create the simplest table to a pretty complex table.

Here are all of the available options and their defaults:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
      :table_class        => 'display_grid', # CSS class name of the table
      :table_id           => "display_grid_#{objects.first.class.to_s.underscore.pluralize}", # CSS ID of the table
      :heading_class      => 'display_grid_heading', # CSS class name of the first TR (one containing TH)
      :heading_id         => "display_grid_heading_#{objects.first.class.to_s.underscore.pluralize}", # CSS ID of the first TR
      :th_class           => 'display_grid_th', # CSS class for all TH elements
      :tr_class           => 'display_grid_tr', # CSS class for all TR elements
      :td_class           => 'display_grid_td',  # CSS class for all TD elements
      :even_odd           => true, # Should even/odd classes be added
      :format_date        => nil, #nil | lambda{|datetime|} # Time formatter (receives date object, expects string)
      :numeric_td_class   => 'numeric', # CSS class for any TDs containing a number
      :date_td_class      => 'date', # CSS class for any TDs containing something date-like
      :string_td_class    => 'string', # CSS class for any TDs containing a string
 
      # Any of this will create an 'Actions' heading, the lambdas receive the object, and expect a string
      :show_action        => nil, # lambda{|object| link_to '', my_path(object)}
      :edit_action        => nil, # lambda{|object|} 
      :destroy_action     => nil, # lambda{|object|}

Using it is pretty easy, just drop it in your app/helpers folder and...

1
2
3
4
display_grid(User.all, {
  :show_action => lambda{|user| link_to user.display_name, public_user_path(user) }
  :table_id => 'cool_users'
})

Its pretty simple. It'll dump out a table, and then you can go and style it using the CSS classes/ids above.

Woot, back end DRY.

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

11Feb/113

Hey fatty!; or my preliminary Slow Carb diet results

In the past 35 days I have gone from 211 pounds down to 194.6 pounds. And I did it without doing grueling workouts and honestly without sacrificing too much on a diet.

Around Christmas I had just gotten a copy of The Four Hour Body by Tim Ferriss. I was really interested in losing a lot of weight easily. Something I hadn't been able to do in almost 9 years of trying very hard.

There are a lot of doctors, experts and speculators that criticize the book saying that the plans couldn't/didn't work. There are a lot of people out there that have changed their lives that beg to differ, and I am one of those people.

My backstory
I'm 30 years old. When I was 22 I started to get a little chubby, not giant, but I rocked a serious beer gut. By the time I was 26 I had started to get kinda fat. Up around 220lbs on a 5'10" frame. Started to get that second chin too, not cute.

My harajuku moment
Around the end of 2009 was the first time I had ever accurately had my body fat measured. I had 20.2% body fat and weighed just about 215lbs. I have a sweet tooth and love burgers, so I had difficulty losing weight even while I was working out. The treadmill wasn't cutting it, and with 1/5 of my body being fat, I was really disappointed in myself.

My exercise plan
March 2010 I began P90X. I didn't want to get muscular so I did P90X Lean, I busted my ass for three months, but I'd go on and off the diet. I'd do really well for a week, not see my weight change, then I'd snack because I figured, "hey, carrots and juice aren't making me skinny anyway."

After my 90 days of P90X I didn't have the awesome abs and body that you see in the infomercial, but I did the work out every-single-day. Nothing really changed, I had significantly more endurance and lost about 4 lbs, but that was it.

So what to do?

I tried again.
I did P90X for another 90 days doing the regular program and I started cycling to work every day I could. I thought that my problem with P90X was going with the Lean program rather than the more intense standard program - I didn't blame it on my snacking which only happened once or twice a week and I sure as hell didn't blame it on my lattes.

After my second 90 days of P90X I can drop and do 100 push-ups easily. My arms and shoulders are pretty well defined, and I have some pretty creepy muscular legs. If the rest of my body looked like my legs, you'd be banging me right now (all cycling and plyo).

I still had a fatty core. I had gotten my weight down to 211 and my body fat down to 18.8%. All-in-all I had some neat results, but I was still disappointed.

My new plan
After reading the Four Hour Body and hearing about people losing all the weight I wanted to lose in 30 days and not working out 7 days a week. I figured it was way easier than P90X so why not? It's only 30 days!

For me, numbers are inspiration and if I see something changing, I get happy. Nothing changes, disappointment.

My first step was to buy a high quality scale that could "accurately" measure weight and body fat. I wanted to see it every day, and I need the mental/emotional reward of seeing my numbers go down.

I decided to move into the diet one meal at a time. I was going to replace my breakfast that normally consisted of either a bagel or a donut and a medium latte with the very standard eggs, beans and spinach. During the initial phase I also stopped working out completely because I wanted to ensure the results were coming from the diet.

The results were amazing. For two weeks I replaced just my breakfast with a slow carb meal. I ate just as bad as I normally do for lunch and dinner. Milk and carbs are a trigger food for me. I dropped my weight to 197.8 from 211, that's just about 13 pounds.

Unfortunately after those two weeks I got bronchitis and didn't 'feel' like being on the diet while I was sick, I wanted comfort food. I slowly teetered back to the over 200 mark by adding milk and carbs back into my diet in the AM.

Where I am today
This morning I weighed in 194.6 pounds and 15.1% body fat.

I've been back on the diet now for only two weeks. Last week only doing slow carb meals twice a day and having a 'normal' dinner. This week I've been doing slow carb meals for every meal.

The most important thing about the book is that it's about experimenting. If it doesn't work, figure out why or don't do it.

I succeeded by setting little goals for myself and being persistent with knowing what was happening to my body quantitatively.

Now for the first time in almost 10 years I weigh less than I did in college and I'm on my way to having a torso like these super sexy legs I'm rocking.

I have shifted my focus from my weight to body fat percentage. I'm tweaking things to maintain my 3% monthly drop in body fat and the new target is a cool 12%.

I've also started working out again, but I'm doing the kettle bell and slow cadence workouts described in the four hour body rather than intense time wasting workouts like P90X as I'm going for definition, not endurance. If the exercise plans have the same effect as the diet I'll see you bedside mid-March.

Update
As of February 17th, I dropped below 190. I'm losing on average 1/2 to 1 lb a day.

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

2Nov/100

Keeping a Software Development Journal or Diary

I'm the kind of person that keeps tons of notes on my thoughts as I am developing on a new project. I generally abuse the README file in my project. It was a mixture of my notes and other information for the project organized by topic - where applicable.

Recently I started keeping a JOURNAL file in my projects that was a day-by-day dump of what I was thinking and why I chose certain choices. It is a really nice way of organizing your thoughts and providing a way to look back through "what you were thinking." It also provides other developers working on the project a way to look at how you came to a certain conclusion.

I was originally doing this in markdown, but recently went searching for TextMate plugin. I found a really great one called JournalTasks.

I've been making two entries a day on my project. One I keep 'open' all day dumping my thoughts on implementation and any interesting choices as well as good references I find while doing research. I have a second one I make when I'm wrapping up as a checklist of what was accomplished (pretty much a git commit log and some additional notes) and what I need to work on next. The plugin also outputs using markdown, supports tagging/searching your posts and simple tasks support.

If you aren't keeping a journal of your thoughts during development, I'd suggest it. A well organized record of your brain; its a good thing.

Thanks to Alan Schussman for a great bundle (and saving me the time of writing one).

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

1Sep/100

Music180 and Vokle: How to get a development deal. With Lucas Kelller of The Collective and Music180

Aww, my little web sites are working together, cute.

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Filed under: Random No Comments
26Aug/100

What I’m working on: Music180 an artist development platform where you can meet real top producers, songwriters and more.

I've been working on Music180 now for a few months. The site is getting pretty cool. I figured I would share it here in case anyone was interested.

Music180 is an artist development platform where you can meet and work with the world's top producers, songwriters, managers and more.

There is also of course my profile where you can contact me for designing band web pages, if you are so inclined. Cory ODaniel on Music180

You are in the know.

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Filed under: Random No Comments