Watched "I Hate Christian Laettner"

Blog

Per Andy's suggestion, tonight's movie was "I Hate Christian Laettner" - a documentary about the rise of Duke basketball in the late eighties / early nineties, and the particular love/hate relationship fans had with Duke basketball and Christian Laettner in particular.

The IMDB blurb goes something like:

He made perhaps the most dramatic shot in the history of the NCAA basketball championship tournament. He's the only player to start in four consecutive Final Fours, and was instrumental in Duke winning two national championships. He had looks, smarts and games. So why has Christian Laettner been disliked so intensely by so many for so long? Maybe it was the he stomped on the chest of a downed player, or the battles he had with his teammates, or a perceived sense of entitlement. But sometimes, perception isn't reality. Directed by Rory Karpf, I Hate Christian Laettner will go beyond the polarizing persona to reveal the complete story behind this lightning rod of college basketball. Featuring extensive access to Laettner, previously unseen footage and perspectives from all sides, this film will be a "gloves-off" examination of the man who has been seen by many as the "Blue Devil Himself".

Blah blah blah.

Essentially, you have an elite school, you have a strong athletic program, and you have a good looking student who is a great athlete and who doesn't give a f--- what you think about him.

Throw in the irrationality of sports, the irrationality of the polarizing need to belong manifesting itself in an us-vs-them mentality, and the perspective (or lack therefore) of youth, and you have a recipe for the perfect villain.

All great stories need a villain, right?

I found the documentary fascinating, doubly so as I wasn't expected to like it at all.

The level of hatred people have for this guy, who doesn't give a crap about his haters, is stunning. How can you hold that much hate for a basketball game? I really don't understand, making the whole thing even more fascinating.

The documentary broke down the reasons for the hatred into 5 parts, explaining there was the perception of elite (Duke University), even though Laettner was from a working class, blue collar family. Laettner didn't act like it, and didn't disavow people of their notions he was from a rich family (likely because, see above, he doesn't care what you think), so the myth perpetuated. He's good looking. He's white. He won games.

And he was a bully.

And this is when I realized I didn't and wouldn't hate Christian Laettner.

I would f---ing hate his brother, Chris Laettner

Yeah, his older brother is named Chris. And THIS is the guy who bullied Christian for YEARS. An asshole older brother. He admits his tormenting. He relishes in how he bullied his younger brother. "Oh, I made my brother tougher!" No, dickwad, you made him a bully. Chris still laughs about his bullying of his younger brother 40 YEARS LATER.

Not every blade survives the annealing process. Surviving childhood bullying isn't easy, and it has lasting consequences, a lifetime's worth. So, yay, your brother became a great college basketball player. Good for him. Your kind of behaviour creates tens of, hundreds of, thousands broken people, laughing about it or perpetuating it is not acceptable.

So, no, don't hate Christian Laettner. Hate Chris Laettner.

And naming your two boys Chris and Christian? I really want to know how that conversation went when deciding the names. I find the dual Chrises both confusing and amusing.

Principles of Object Oriented JavaScript

Book Notes

As part of my belief that one should never stop learning, I keep trying to learn. This month's learning involved reading this book, Principles of Object Oriented JavaScript, a relatively short book by Nicholas Zakas.

I'm comfortable in JavaScript, but, really, haven't ever taken the time to read about some of the insides of the language. I'm glad I picked up this book.

This book is a quick read, about 132 pages of content and 25-ish of index, depending on the format you read the book and the font size you select. The book covers primitive types, reference types, built-in types, function declarations vs function expressions, objects in general, property attributes, object constructors, object prototypes, property attributes, inheritance and various object patterns. The code examples are clear, the writing voice conversational.

I had a couple "Ohhhhhhhhh!" moments, which were fun, with a lot of head-nodding-yep-I-knew-that moments, too.

I liked the book. Recommended.

Progress

Blog

Gerrit Theming for Front-end Developers!

Tutorial

Gerrit is a code review tool for git. You can think of it as a self-hosted alternative to github, with a number of server-side extensions to make it handy and useful. It's hosted on Gerrit's Google Code, though I'm not sure how that'll last, as Google Code is going away. Something at Google Source, maybe?

Anyway, an end-user difficulty with Gerrit is that it pretty much looks like ass.

Okay, that's not fair. It doesn't look like ass, it does, however, look like gmail.



So, how does one theme Gerrit so that it doesn't look like ass? You can google, "gerrit theming" (a good example), discover Gerrit is written in Java, using GWT, the Google Web Toolkit, and pull your hair out with how cumbersome adding a CSS framework to it is.

Or, you could exploit the way Gerrit DOES allow customization.

According to the Gerrit documentation, you can have three files:

  • <theme-dir>/GerritSiteHeader.html
    HTML is inserted below the menu bar, but above any page content. This is a good location for an organizational logo, or links to other systems like bug tracking.
  • <theme-dir>/GerritSiteFooter.html
    HTML is inserted at the bottom of the page, below all other content, but just above the footer rule and the "Powered by Gerrit Code Review (v…​.)" message shown at the extreme bottom.
  • <theme-dir>/GerritSite.css
    The CSS rules are inlined into the top of the HTML page, inside of a <style> tag. These rules can be used to support styling the elements within either the header or the footer.

So, to theme Gerrit, you edit the GerritSiteHeader.html, GerritSiteFooter.html, GerritSite.css files, and boom, you can have your new theme. Easy, right?

No.

There's the first part of the problem: the GerritSite.css file IS NOT THE LAST CSS FILE TO BE INCLUDED.

So, be sure to add !important ALL OVER YOUR NEW GerritSite.css file. That's fine, easy enough, but how do you add things like, nice menu bars, good white space, and a CSS framework?

Well...

The GerritSite.css file is included straight.

This means, you can start your GerritSite.css file with this:

</style>
<script>
</script>
<style>

See that? See those script tags?

Yep.

So... here's what you do.

  1. Download jQuery, unzip and find the minimized javascript file.
  2. Download a customized version of Bootstrap, with only the components you need. I recommend Grid System, Tables, Forms, Navs, Navbars, and Dropdown.
  3. Download the jQuery arrive plugin.

Gerrit uses GWT, which means that everything is a bizarro java javascript single page weirdo application, which also means that the base HTML is stunningly sparse and everything loads via javascript WAAAAAAAAAY after the document is done loading and is ready. You can't use the usual $(document).ready(function(){}); snippet for triggering off events.

Enter the jQuery arrive plugin.

The plugin watches for DOM element creation and triggers events when they show up. Hot damn.

Take the minimized files, and concatenate the javascript together into a new file. The Bootstrap CSS downloads as a minimized file already.

$ cat jquery-1.12.0.min.js bootstrap.min.js arrive.min.js >> min.js

This file is going to be included in the GerritSite.css file, in this order, with these tags:

</style>
<script>
# minimized javascript goes here (min.js)
</script>
<style>
# minimized CSS goes here (bootstrap.min.css)
</style>
<script>
# custom javascript goes here
</script>
<style>
# custom CSS goes here

Save that file in your theme directory (mine is install/etc), and refresh the page.

Once that's done, we are ready to style things in earnest!

Instead of using .ready(), you now want to use .arrive():

$(document).arrive("#gerrit_topmenu .topmenuMenuLeft"), function() {
  // the menus have arrived, manipulate them to add bootstrap styling
});
$(document).arrive("#gerrit_body table.changeTable"), function() {
  // the content has arrived, manipulate it to add bootstrap styling
  $('table.changeTable').addClass('table table-striped')
});

As mentioned, gerrit loads another CSS file after the GerritSite.css file, so you might need to add a large number of !important attributes, which is annoying, and necessary.

More tips, after adding CSS at the bottom of the file and testing during development, be sure to minimize the CSS and any Javascript you've added. This solution added an extra 250kb to my install, so this isn't a lightweight solution.

It is, however, a fantastic way to get easy customization without having to recompile gerrit or, shudder learn GWT.



Watched The Martian

Blog

We watched The Martian tonight. Having recently read the book, I was, surprisingly, eager to watch the movie. Yes, yes, the book was better, but I find interpretations of books as movies to be interesting, sometimes fascinating. The director has a story to tell visually in a short amount of time (making, of course, mini-series a better, but less profitable, choice for telling longer stories), and has to choose what to include and what to discard, what is important to telling the story and what is inconsequential. The interpretations are, of course, open for debate, and always loudly criticized by purists and readers.

I enjoyed the movie. It wasn't completely true to the book, but was close enough to be fun. The ending was made MORE DRAMATIC, which was unnecessary given how exciting the book was, but, hey, Ridley Scott. The movie was also a rushed version of the book: you lose both the sense of urgency the book conveys (the man is starving to death, isolated, and in mortal peril for a long time), and the sense of humour of the book.

Still, lots of fun.

Pages