• Better Colors in Vim

    I'm a sucker for pretty editors. Webstorm, Atom, Sublime and others have always have been better looking than Vim. Vim and the terminal simply weren't able to support the 24-bit colors that the other editors could. Macvim did a lot to improve the situation but I really like to use Tmux, iTerm2, and Neovim together.

    Luckily, while doing some research on the topic the other day, I finally got 24-bit color support via iTerm (nightly), Tmux, and Neovim.

    Here is how to accomplish it.

    1.) Install Neovim. Here are the install instructions for Homebrew on Mac. Once complete, add the following to your Vim config file.

    let $NVIM_TUI_ENABLE_TRUE_COLOR=1  
    

    2.) Download the nightly version of iTerm2. It supports 24-bit color.

    3.) Install a patched version of Tmux that supports 24-bit color.

    brew tap choppsv1/term24  
    brew install choppsv1/term24/tmux  
    

    Finally, here is what my setup looks like in all it's colorful beauty.

    If you'd like to checkout my dotfiles and Vim config they are on Github here.

  • How to Create New Postgres User

    I was doing some work in Knex today, the fantastic SQL builder for node and needed create a new user. It took some research but here is what I found:

    This assumes you've already logged into Postgres with another user.

    CREATE ROLE myUser WITH LOGIN PASSWORD '';  
    GRANT ALL PRIVILEGES ON DATABASE "knex_test" TO myUser;  
    

    To test it out just log back in.

    psql -h localhost -U myUser -d knex_test  
    
  • Format XML Files

    Today I found myself looking through hundreds of unformatted XML files. I did some googling and found the following script that makes use of xmllint to format all the files and save copies of them to a 'formatted' folder.

    find . -maxdepth 1 -type f -iname "*.xml" -exec xmllint --format '{}' --output formatted/'{}' \;  
    

    Worked like a charm (on Mac OS).

  • TXJS 2015

    I had the privilege of attending the Texas Javascript 2015 conference this past week. It had a stellar line up and I'd recommend watching the recorded live stream if you weren't able to attend.

    The following were the highlights for me:

    Cold War Simulation by Simon Swain

    Simon had both an incredible slide deck and demo. He highlighted some impressive things that can be done with using Canvas. I rarely have an opportunity to use Canvas but his presentation makes me want to take a new, lengthy look at it.

    Client Side Security by Yan Zhu

    This presentation sent chills down my spine. Yan demonstrated some terrifyingly simple security holes that I wasn't not aware of. But, she also showed some great new additions to browsers that will give developers tools to plug these holes and make the web a safer place.

    Select Box Usability by Alice Bartlett

    I really enjoyed this presentation. Alice explained the significant usability problems with select boxes. She played some videos of people struggling to figure out how to do the most basic tasks simply because of the select box control. It was a real eye opener and highlights that as developers we can't take for granted our tech savviness and need to analyze every element we add to a site.

    Service Workers by Jake Archibald

    The hilarious Jake Archibald walked us through using Service Workers to build more performant and offline sites. He had a very interesting demo for using Service Workers to help users with spotty connection. I can see a lot of potential Service Workers in the future to load assets in the background and speed up page load time. I'm very excited to try them out!

    There were many more interesting lectures so I'd definitely recommend watching the live stream. But, if you don't have time to watch the live stream, then at least take a look at G. Scott Olson sketchnotes for the conference.

  • Developers Are in the UX Business

    UX is often thought of as the visual design of software. Though it's an important part of crafting a great user experience, there is much more that must be considered.

    A great experience for users requires focus on many parts of the software: visual design, reliability, ease of use, and performance, to name a few.

    I've often heard programmers say "not my problem" with anything concerning UX. But it's my opinion that programmers are just as critical in shaping the user experience as any designer, perhaps even more so. Programmers are the ones in the trenches, constructing the user experience and must be on guard at all times for problems.

    If routes fail, performance is horrible, or features are buggy, then the user experience suffers, often horribly. Just ask yourself what your most common complaints about software are. For me it is slow loading pages and mobile pages that don't behave. These are problems that programmers need to be aware of and work to fix.

    Steve Jobs once said of design:

    Most people make the mistake of thinking design is what it looks like. People think it's this veneer -- that the designers are handed this box and told, 'Make it look good!' That's not what we think design is. It's not just what it looks like and feels like. Design is how it works.

    We're in the UX business. We can't forget that "how it works" part is a big part of that.