Shawna C. Scott

Learning to hack, one day at a time

Menu Close

Tag: wp

Fixed Height Sticky Footer CSS, via CSS Tricks

I don’t know about you, but I absolutely hate footers that float in the middle of the page if the page has very little content. Like this:

Look at all that whitespace. Ick. I suspect I’m not alone in this, since I rarely see footers that don’t stick to the bottom of the window and then expand to accommodate more content. And yet, it’s not very straightforward how to make that happen. Even good ol’ Bootstrap doesn’t have a class for it.

Twice now, I’ve had to spend more time than I would like using the junior dev answer machines to figure it out.

So, now recorded for posterity:*

Sticky Footer by Chris Coyier @chriscoyier on CodePen

One caveat: This technique only works for fixed-height footers

Properly Factored MVC in Rails Applications

EDIT: After feedback from Katrina Owen Herself, I wanted to include the “much improved” version of the tutorial, as well as Katrina’s amazing five-part series on Golden Master testing


 

Recently, I wanted to learn more about refactoring, and about general best practices for structuring Rails code. Generally, when I’m working on a feature, I don’t spend the majority of my time figuring out how to make something work. I spend most of my time trying to find the best way to make it work.

As a new programmer, though, I have to rely on external resources, since I don’t yet have that internal lexicon of good and bad design patterns to point me in the right direction. So, this past weekend, I decided that I wanted to learn more about Rails best practices, and about refactoring. Imagine my delight when I found this great workshop and accompanying tutorial, “Properly Factored MVC”  [tutorial] (see edit) from RailsConf 2013, presented by Katrina Owen and Jeff Casimir.

I finished the video, although I haven’t worked all the way through all the tutorial iterations yet, and I’ve already learned a lot about the theory of refactoring, and how to insure your refactoring doesn’t cause regressions.

If the 1:43 runtime of the video is daunting, you can just work through things from the tutorial alone. Personally, though, I found the video helpful, since Katrina Owens is talking through her thought process as she goes in more detail.

Hope you find this resource helpful!

PS: If you feel inspired to help refactor some Real Live Code ™ after this, feel free to hop on over to the very beginner-friendly open source project, Calagator. I’m a contributor there, and there’s plenty of places to test and expand your skills!

On Tumblr: http://junior-dev-lessons.tumblr.com/post/99540321305/properly-factored-mvc-in-rails-applications