Groking Conferences

Profile
by Jess Brown

I just recently attended Grok. I'm not a big conference goer, but I've attended LessConf several times and a few ruby conferences. Sometimes I always wonder why people go to conferences and how they justify the expense. As an independent consultant, I'm always trying to figure if my money and time was well spent. I once heard another consultant say "how can you not afford to attend conferences."

They're not cheap. Grok was inexpensive as far as conferences go. Here's my expense summary:

Ticket:    $ 200
Hotel:     $ 600
Gas:       $ 100
Dining:    $ 150
Misc:      $  50
Lost Work: $1500 # 2 days x 6hrs day billing @ 125hr
--------------
Total:     $2600

Now this is a real expense for me. My bank account will be $2600 lower had I not gone to this conference. That's a small marketing expense for GitHub or Pardot, but a much larger % of my bottom line. That's a nice MBP or almost a new bike! So was it worth it? I don't know the answer to that question so I want list some reasons why I go.

1. Fun

I work from home and don't typically get to hang out with people who do creative technology stuff like I do. Spending time with them and getting to chat about the latest cool thing is awesome.

It's fun to travel.

Conferences also do cool things like schedule us to drive high performance BWM's!

Allan branch cebo Allan & Cebo about to make all the driving instructors very nervous.

2. Learn

You learn lots of things a conferences. It's not always technical. It could be things about teamwork, process, sales, or all sorts of stuff. You get to talk about what everyone's talking about and be a part of the conversation.

Grok is especially good at this. They have 10/20's where you get to split up into groups and have relevant meaningful discussions.

3. People

The people has to be one of the biggest reasons you go to a conference. You get to reacquaint with friends and people you've met from other conferences. You get to meet heroes, people that inspire you, people you've been following on twitter for years, but never met.

Matthew smith Matthew Smith aka @whale and I about to entrust our lives to someone else driving a fast car. Matthew is a design super hero.

Some of the best experiences you have are meeting people that you didn't know existed. I love meeting new and interesting people and it always makes me a little sad when I see photos of photos after the conference of people I didn't even get the chance to meet.

4. Business / Networking

There is a business reason for me to going. My hope is that by meeting people and making friends and connections, I'll be in a position someday to help them solve a problem or build something really great. I hope that I can be at least close enough in people's circles that if they have a need for web / rails developer, they might remember that nice good looking (ok that's a stretch :-) guy they met and consider me.

5. Inspiration

There's usually a keynote speaker or two there by design to deliver inspiration. At Grok this year, for me, it was Kristian Anderson.

He talked about the misguidance of following you passion. My take on it was while you should do something you enjoy, you shouldn't do it just because you enjoy it. No matter how much I want to be a pro cyclist, it isn't going to happen. You have to do what you're built for and also what you're willing to suffer (ie what real passion means) for.

This hit home for me because as a designer and developer, I struggle with the thought that I should strive to be great at one or the other. But I know I can never be the next Matthew Smith or Aaron Patterson, but put the two together and mix in a little business smarts and I might have something unique to offer.

You can always find little takeaways like that to bolster your confidence and help you focus on what you're willing to suffer for.

6. Getaway with Wife

Most conferences I go to my wife comes with me and my kids do not. It's a great opportunity to spend a few days (my kids are young so we don't stay gone long) away. She doesn't usually go to the conference, but she'll come with me to the dinners and hangouts.

Patty Patty really wishing I'd stop taking her picture in the hotel lobby.

Not all bliss

Despite all of the positives, I'd be remiss if I didn't say there are hurtles as well. Besides the financial cost, mixing and mingling can be extremely difficult for some. I figure I fit more in the "outgoing" category and I still have a ton of insecurities. This is no reflection on Grok or any other tech conference. In my experience, they're always fantastic. The problem is our fears.

Logically thinking, I believe I'm a cool guy, have a pretty wife, a successful business, am friendly, and am experienced at what I do, but emotionally, I have a ton of insecurities at conferences. I worry that I won't be cool enough, or that I people won't like me. I worry that people will not want to talk with me if I walk up to them, or that they wished they'd sat beside someone else. I stress about why people don't follow me back on twitter or ask me to dinner too. I wonder why people don't take photos with me or mention me in their feed.

I was expressing these to my wife one night and she said, most of the others have them too. I suppose she's right. Regardless, it's just a part of being human, putting yourself out there and being willing to make yourself venerable. Without doing that, you'd never get to enjoy all of the positive experiences and meet so many cool people. So if you feel a little like I do, just remember, others feel the same way.

Summary

All in all it's a great experience. Grok was exceptional and I already know I'll be back next year. Hopefully the relationships I rekindled and started will evolve further. Hopefully several cool projects will come my way via a referral from a fellow groker!

So, my final conclusion is: conferences are worth it. You can't go to them all, but selectively choose at least several a year to attend and it'll be worth your trip!

Follow me on twitter

Reformatting With Vim

Profile
by Jess Brown

If you're using markdown a lot with vim, you may have run into an issue with formatting. After you type a paragraph, then go back to edit, the auto softwrap that happens, gets off when you add or delete text.

This used to drive me nuts, until I found a simple fix. gq will reformat the line and reset the wrapping. Most of the time, you'll need to fix the whole paragraph because any edits typically effect lines and words afterwards as well. So, you can select the whole paragraph and reformat with vipgq.

I ended up mapping this to a shortcut:

# .vimrc
map <leader>al vipgq

Adding A Custom Field In Refinery

Profile
by Jess Brown

If you're a developer, you're always wanting to tweak and configure things to your liking. This is one reason I love working with Refinery CMS.

I was recently building a CMS for a client and in the design there was a main image at the top of the page:

Hardlabor

I wanted my client to easily be able to swap this image out for another if they wanted. I wanted a field on the Admin > Edit Page screen that allowed control of this image. Refinery made this easy to do. Here are the steps I took to do it.

Add the field

rails g migration AddMainPhotoToRefineryPages main_photo_id:integer
rake db:migrate

Here we're creating a field in the main refinery_pages table and it's a foreign key. The foreign key will link to an image we add to the refinery_images table, which is making use of Refinery's existing method of handling images.

Update the admin form

To update the Admin > Edit Page form, you just need to override the view:

rake refinery:override view=refinery/admin/pages/_form

Now open app/views/refinery/admin/pages/_form.html.erb and add the below code to your form (I added it underneath the "form_fields_after_title" partial)

<div class="field">
  <%= f.label :main_photo %>
  <%= render :partial => "/refinery/admin/image_picker", :locals => {
    :f => f,
    :field => :main_photo_id,
    :image => f.object.main_photo,
    :toggle_image_display => false
  }
  %>
</div>

Permit the field

I'm using Refinery on Rails 4 which uses strong_parameters, so we need to permit this field so it will be accepted in our create and update actions. To do this we can make use of Refinery's decorators. Create a new file app/decorators/controllers/refinery/admin/pages_controller_decorator.rb and insert this code:

Refinery::Admin::PagesController.class_eval do
  def page_params
    params.require(:page).permit(
      :browser_title, :draft, :link_url, :menu_title, :meta_description,
      :parent_id, :skip_to_first_child, :show_in_menu, :title, :view_template,
      :layout_template, :main_photo_id, parts_attributes: [:id, :title, :body, :position]
      )
  end
end

Here we're just overwriting the method in Refinery's admin pages controller that defines the page params allowed and we're adding our :main_photo_id field to it.

Setup the relationship in the model

Now we just need tell rails what to relate the main_photo_id field to. We can do that with a simple belongs_to. Create a new file app/decorators/models/refinery/page_decorator.rb

Refinery::Page.class_eval do
  belongs_to :main_photo, :class_name => '::Refinery::Image'
end

Mainphoto

Now we have a simple field we can use to add or remove the image. There's just one more step: we need to specify how we want that image to show up in the view.

The Display

Depending on your design, there's lots of ways you could use the image we saved in the admin, but here's how I did it.

If you don't already have the show page overridden, go ahead and override it:

rake refinery:override view=refinery/pages/show

Now open app/views/refinery/pages/show.html.erb and place this code where it belongs on your page:

<% if @page.main_photo.present? %>
  <%= image_tag(@page.main_photo.url) %>
<% end %>

That's it! Let me know if you have any questions.

How To Put Creative Work First

Profile
by Jess Brown

Last year I went on vacation to Okaloosa Island. Going on vacation for a small business owner is tough. I usually get Scott to check my email for me, handle anything pressing, and respond to others telling them I'm out of town. On this trip though, he was going to be out of town too. So I decided I'd check email once in the morning and once around lunch. To my surprise, I was able to 1) quickly process email, and 2) no one really seemed to notice I "didn't respond right away".

Creative work first

I recently read Manage Your Day-to-Day: Build Your Routine, Find Your Focus, and Sharpen Your Creative Mind. Close to the beginning of the book, I picked up on a quote:

The single most important change you can make in your working habits is to switch to creative work first, reactive work second. This means blocking off a large chunk of time every day for creative work on your own priorities, with the phone and e-mail off.

Manage your day to day

That coincides with a tip read a long time ago that suggested to never check email first thing in the morning.

Email is definitely reactive work. You can sit around for hours answering email and getting distracted from your creative work.

How to turn email off

The problem with ignoring email is that I need my email to work. Clients send me copy, images, instructions, etc and I need access to that. But if I go to my inbox and see new messages, it's too tempting to get distracted. I recently found a tool for gmail to turn email off. It's called Inbox Pause. Inbox pause helps by pausing your new incoming email. It does this by adding a hidden label to the email. Your email will be delivered to the inbox in one of two ways. You can manually unpause your inbox, or you an setup a schedule for emails to be delivered. I use the latter so I can stick to a schedule of blocking off time for creative work and blocking off time for email.

My email arrives at 12:30p so I can check either before or after I get back from lunch and at 4:30p so I can check at the end of the day and make sure there's nothing urgent to do before going home and so I can plan accordingly for the following day.

This process has been working for me so far ( I'm happy enough to write a blog post about it ). I can focus on my creative work, I can focus on knocking out email when I'm done, and I'm not distracted by email in the evening when I should be spending time with my family.

I know there's thousands of strategies to handling email so choose your flavor, but I'd definitely recommend giving this one a try. Here's a short clip about it:

Foundation Menu In Refinery

Profile
by Jess Brown

The sign of a good open source platform is when you want to do something outside the box, how easy is it to modify. Well Rails and Ruby are particularly good candidates and Refinery doesn't hold them back.

I was recently building a Refinery CMS and was using Zurb Foundation for the front end framework. If you've used Foundation before, you'll know that the top menu requires specific markup and unlike many of the other components, doesn't have mixins that you can use to implement it.

My menu needed to look something like this:

<section class="top-bar-section">
    <!-- Right Nav Section -->
    <ul class="right">
      <li class="active"><a href="#">Right Button Active</a></li>
      <li class="has-dropdown">
        <a href="#">Right Button with Dropdown</a>
        <ul class="dropdown">
          <li><a href="#">First link in dropdown</a></li>
        </ul>
      </li>
    </ul>
</section>

The Refinery menu html looked like this:

<nav class="menu clearfix" id="menu">
  <ul>
    <li class="selected first"><a href="/">Home</a></li>
    <li class="last"><a href="/about">About</a></li>
  </ul>
</nav>

In the past, Refinery had used view partials to implement the menu, but in an effort to clean the code up and make the menu more efficient, they changed it to a presenter. Now Refinery uses this one call from a view to to implement the menu:

<%= Refinery::Pages::MenuPresenter.new(refinery_menu_pages, self).to_html %>

I didn't immediately know the best way to solve this, so I fired off a quick Github comment and one of the primary maintainers immediately wrote me back (testament to their responsiveness). He said, just subclass it and overwrite the methods.

That actually turns out easier than it sounds. Just create a new file in app/models/foundation_menu.rb.

class FoundationMenu < Refinery::Pages::MenuPresenter
end

Now we can start overwriting the methods we need. The first is the render menu method:

class FoundationMenu < Refinery::Pages::MenuPresenter
  def render_menu(items)
    content_tag(:section, :id => "nav", :class => 'top-bar-section') do
      render_menu_items(items)
    end
  end
end

Here's the diff on that method:

Render menu diff Click to enlarge

Render menu diff

×

As you can see, we're just slightly changing the methods. Here we changed the content_tag to be a section instead of a nav, the id to be nav instead of default one and the class to top-bar-section

There's a few more changes that need to be made and one addition to get the dropdown menu working. I'll link to it here so you can use it if you like. Refinery Foundation Menu

Once you have your subclassed menu presenter in place, no you just need to link it up in your view:

# app/views/refinery/_header.html.erb
<div class="row">
  <div class="columns large-12">
    <nav class="top-bar" data-topbar>
      <ul class="title-area">
        <li class="name">
          <%= link_to image_tag( "logo.jpg" ), refinery.root_path, width: 100, height: 75 %>
        </li>
        <li class="toggle-topbar menu-icon"><a href="#">Menu</a></li>
      </ul>
      <% menu = FoundationMenu.new(refinery_menu_pages, self) %>
      <% menu.max_depth = 1 %>
      <%= menu.to_html %>
    </nav>
  </div>
</div>

It'd probably be cleaner to extract this out to a heleper or in ApplicationController

Having a system that is flexible and easy to extend and override is awesome for a programmer. I've built quite a few projects using Refinery CMS and I continue to be happy with that I can accomplish.