Made with Drew

Go enthusiast

Pipelines in Go Templates

Go templates mix an excellent blent of flexibility and powerful features. The html/templates package even has context aware templating for handling HTML escaping and JavaScript variable declaration. One thing I tripped over is using the very powerful pipeline feature to specify custom pipelines. This worked fine for a single template, but I kept getting. panic: template: view.tmpl:9: function "titleExpand" not defined Doing this on each template is cumbersome, here’s how I applied titleExpand to all templates.

Working with dppx

There’s a better metric in retina detection called dppx, Chrome Canary will now warn you for continuing to use dpi. Glossary device-pixel-ratio: Number of device pixels per CSS Pixel dpi: Dots per inch dppx: Number of dots per px unit. 1dppx = 96dpi Now your first question, why do we need dppx when device-pixel-ratio exists? Well in typical fashion, CSS was too slow on fixing the CSS resolution problem.

Using Bourbon Neat

In my last post, I talked about what I had done but not how I did it. Now let’s get into the nitty gritty of Bourbon Neat. Bourbon is installed via the neat gem, once installed you can call neat to manage everything about neat. neat install neat update neat remove This will install neat to a subdirectory, much like how bourbon is installed. The beauty of SASS is that we now have installed a ton of fundamental CSS functionality, but we get to pick and choose which features we want to take advantage of.

Bourbon Neat

At work I was tasked with building a new Tablet version of the site. As a greenfield project, every stakeholder had two cents on how the project should go. Things I heard: We need fat finger support Our desktop site is ugly How can we improve click through rate on Tablet? Can we support responsive web aka Browser Wanking? As many projects go, we leaped straight into answering all these questions without really thinking about what it all means.

New job

I started a new job and haven’t had much time to update the blog or various github projects. Well actually I’ve had plenty of time to update these, but I haven’t due to major data loss with my SSD. As part of the job move, I have also relocated to Austin, TX. It’s been a pretty stressful move, but everything is in it’s place now and I’m back on track running regularly.

Getting More

I’ve been reading a book lately, okay that’s a lie. I fell for the Audible trap and have been listening to a few audio books lately mostly while driving in a car. The book in particular is Getting More. Audible is great, especially if your family and girlfriend are a three to five hour drive away depending on Atlanta traffic and if there is a Knoxville/Florida game that weekend. My only beef with listening books instead of reading them is the time involved.

My adventures into WebGL

So I have been pretty busy trying to get into WebGL. It is easily the best way to have a bad time in programming right now. The combination of experimental browser support, bad linux drivers, and JavaScript’s direct mapping to very old C code made it quite difficult. I started by looking at a Learning WebGL. I 100% recommend this especially if you are unfamiliar with the domain. Why would you keep reading this if you weren’t?

jodoc-js

So it’s about time to post an update on things I’m working on lately which have been a lot, just look at my github feed: https://github.com/drewwells Today I want to talk a bit about the documentation framework we are now using at work. It’s rather fantastic and based on a python implementation: https://github.com/davebalmer/joDoc. It hasn’t been updated at all this year, but azakus has ported the whole thing to NodeJS!

Testing for optional false params in JavaScript

Sounds like a silly thing, but sometimes you want optional false parameters. If for nothing else than to make your parameters human readable, not just syntactically convenient. So let’s start out: var config = { //blur: false }; !config.blur //Oh noes reports true The trick here is to detect whether the variable is undefined, then for it’s truthy value. Fixed implementation: if( !config.blur === false ){ //Won't execute } config.

Github

As someone that isn’t afraid to get his hands dirty, I find Github to be a god send. It really makes coding a dream, and it makes collaborative coding amazingly easy. The current project I’m working on involves nearly a dozen libraries. There’s a huge difference between those on Github and those hosted else where. For one, the code hosted else where just sits in my lib directory. I make modifications to it and commit to our internal version control system (Perforce).