How I get things done as a tech lead

I’ve spent the past year as a technical lead for the first time in my career and there have definitely been a lot of lessons learned but in this post I want to focus on personal productivity and time management and the techniques that have helped me in this area. As an individual contributor on a dev team, decisions about what you should be working on are mostly made for you. »

My Always-Up-to-Date VS Code Setup for Web Development

I’ve gone through the setup and daily use of a number of editors over the years including most current popular ones for front end development (i.e. sublime, atom, and vs code) and for me VS code is the best choice for front end development at the moment. The team has put a lot of effort into making it a great javascript experience out of the box and it shows (VS code itself is written in typescript and the team uses vs code to build vs code) and with some additional work you can have the best experience while writing javascript. »

You Should be Using Git Hooks

In my opinion Git hooks are an incredibly useful yet under-utilized feature of git. There are lots of resources that go into hooks in detail but here I’m just going to list some of the ones I find myself using over and over again. prepare-commit-msg This hooks is great for templating your commit messages. This post does a great job of highlighting some powerful possibilities. I like to use it to automatically insert a ticket number from the current branch name. »

Use Netlify for a Poor Man's Self-Hosted Url Shortener

I recently migrated my blog from Github pages to Netlify and so far it’s been an awesome experience! Netlify gives you so much for free it almost feels like stealing! If you’re hosting some static content on github pages or S3 or somewhere, I highly recommend you check them out especially if you have a static gen build process. One of the cool features Netfify gives you is configuring 301 redirects using a simple _redirects file in the root of your site. »

Use npm with a proxy that requires authentication

It’s pretty easy to configure npm to connect through a proxy by setting the proxy and https-proxy config settings and you can even using npm config set will store them in your .npmrc file. Connecting through a corporate proxy that requires authentication, however, can be a little trickier. To specify your credentials, you have to place them in the proxy url so your npm command would look something like this: »

Brandon Pugh

Avoid Committing Dumb Mistakes with Git hooks

TLDR: Git hooks are an awesome way to automatically verify your code as you commit your changes I’m sure we’ve all been there where we accidentally committed a change that we were supposed to undo or wasn’t ready to be pushed and don’t realize it until the build breaks or QA finds a bug. The first step I take to avoid committing anything unintentionally is instead of just running git add -A I make sure to review all the changes in the files I’m potentially committing. »

Brandon Pugh

Checking if a dom element exists with JQuery [Byte sized tips]

This is a simple tip but one I feel makes my code a bit easier to read. I was never very pleased with the standard way of checking if a dom element exits in jquery: if($('#userName').length !== 0){ //do something with $('#firstName') } The solution I like is to create a very simple jQuery plugin to encapsulate this logic: // this extension reads better when selecting elements $.fn.exists = function () { return this . »

Brandon Pugh

How to use jQuery .on() instead of .live()

One of the most used features of jQuery is the easy methods it provides to to attach event handlers to dom elements like this simple example: $('.submitButton').click(function() { validateForm(); }); It doesn’t get much easier than that. However, a lot of times we’ll want to attach events to elements that were loaded after the initial page load such as from the result of an ajax request. This is where the . »

My thoughts on the Global Day of Coderetreat

Last weekend I attended the Global Day of Coderetreat in Dallas, TX which was not only my first Coderetreat but also my first time attending a developer community event and I have to say that it was a great and worthwhile experience. If you’re unfamiliar with the format of a Coderetreat you can read all about it at coderetreat.com but its basically a code kata where you spend most of the day pairing up in 45 min sessions and attempt to solve Conway’s Game of Life (a fascinating problem by itself). »

Getting started with PetaPoco and Postgres

I’m currently working on a project I’ve inherited that uses a Postgres sql backend and I was looking for an easy way to make writing our data access layer less time consuming and painful. My first thought was to use a micro-ORM like Massive but while I’ve heard some really great things about Massive, I felt it might be a tough sell to my team members who aren’t too comfortable with Expandos and its dynamic nature (I know, but change in baby steps I suppose). »