CSS Z-Index Issue

Up until very recently my blog had a z-index issue where you couldn’t click on my top banner to go back to the root. The canvas was at a higher z-index than the hgroup which holds my text bits of the banner image. I tried all kinds of tricks to get it forward but nothing worked. A big thanks to Dave from work for helping me with this fix. It turns out this is the css I needed to make to get it going:

.header-info {
position: relative;
z-index: 2;
}

The position relative is the magic sauce in this incantation… not fully sure how; but this explains what I cannot: Z-Index Blog.

Just a Ten Minute Fix…

"We're Hosed Tommy"

At one point or another, we’ve all been there. You run across a seemingly small problem that can be fixed in a jiffy. Under the surface to your problem; however, lays a sinister set of traps to more problems. Just as you begin to solve one problem, your solution reveals more magnificent issues.

Vim Bindings in Bash

About a month ago I found out that you could configure inputs to work similar to that of Vim. This of course was a happy find and I would like to share what I did to get it as close to what I use.

To get it up and going if you don’t have an .inputrc file you’ll need to make one and add the following lines…

set editing-mode vi
set keymap vi
set show-mode-in-prompt on

This enables vim bindings with bash, and others that use readline such as irb. When you are in insert mode you will see a + symbol at the far left side of the screen and : if you are in normal mode. I have added a bit extras for myself, namely jj as a binding for esc in insert mode:

$if mode=vi
set keymap vi-insert
# Lets you press 'jj' really fast to get out of 'insert mode'
"jj": vi-movement-mode
$endif

One thing I would love to figure out but haven’t had success with yet is modifying the visuals for when you are in insert mode versus normal mode. I would love to change the color of my $PS2 to yellow or something like that when I am in normal mode.

Restarting My Elixir Journey

Several years ago when I was still living in Austin I originally set out to learn Elixir. It’s infancy back then was annoying to say the least for me so I gave up on it at the time. While waiting for 1.0 to sink in I’ve learned up on Erlang, as that was one of the areas I felt I would need to know pretty solid anyway if I wanted to get back into Elixir with any serious intent later.

Here are the books I want to knock out and get running with:

I hope by the end of this month I’ll have some serious headway so stay tuned for posts on what I learn as I revisit this language I’ve lost touch with!

Refilling Your Motivational Tank

"Never fun on E"

It’s never fun, that feeling of getting to work and not being motivated to get started. The smallest tasks turn into feats of willpower and leave you more empty than before. How does one pick themselves up and break the cyclical feeling of defeat?

Multiple Returns With Ruby

I’ve been looking through a fair amount of code lately where the author has elected to use return with multiple values. For those who haven’t seen this witchery, it looks something like this:

def left_right(point, pivot)
return point - pivot, point + pivot
end
left_right(6, 4) # => [2, 10]

I am not a big fan of this and try to avoid it when I write code. To me it hides what is really happening, which is the fact that an array is being constructed that has heavy importance on the order of each value. It also forces you to use the return keyword, which I prefer not to have at all when I can avoid it. (+10 for Erlang not having return)

My Wife Is My Backbone

"My Foundation"

The last week or so has been a challenging time for me. The one thing I’ve always been able to rely on is my wife Cassandra. She is there supporting me when the world feels like too much to take on. I feel incredibly lucky to have her by my side; doing her best to keep patient during my moments of absent minded blundering.

Rails Precompile Failure With Bower Packages

I work with a team where we use bower packages in the vendor/assets/javascripts. Nothing to out of the ordinary, but to compile them for production we use the following block in our config/application.rb:

config.assets.precompile << Proc.new do |path|
full_path = Rails.application.assets.resolve(path).to_path
app_assets_path = Rails.root.join('app', 'assets').to_path
if full_path.starts_with? app_assets_path
if File.basename(full_path) =~ /^[^_]+(.*)\.(css|js)\.?(sass|scss)?$/
puts "\e[0;32m✓ #{full_path}\e[0m"
true
else
puts "\e[1;30m✗ #{full_path}\e[0m"
false
end
end
end

All was well with this up until a package was added that had a bower.json file in it. The package in our case was requirejs-plugins. After adding this package in, during an asset compile we were greated with the following error:

Work Your Hardest or Work Your Best?

An couple interesting phrases you’ll hear tossed around from time to time are, “We’ll have to work our hardest to accomplish this,” and “We’ll need to do our best to accomplish this.” From the outside these two seem very similar; however, when you start to break them down the only two words of difference are hard and best. Curious, are these two words the same? For fun I am going to provide the relevant definitions.

hard: requiring a great deal of endurance or effort.

best: of the most excellent, effective, or desirable type or quality.

It’s normally pretty great when you can work hard and do your best, but it’s not all to fun to work hard and create sub-par quality. Always focus on best over hard. It’s hard to have the first without the second, but don’t automatically assume there is some magical ratio between them.