<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Posts on Brandon Pugh&#39;s Blog</title>
    <link>https://www.brandonpugh.com/post/</link>
    <description>Recent content in Posts on Brandon Pugh&#39;s Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Fri, 02 May 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://www.brandonpugh.com/post/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Indieweb Movie Club - The Castle (1997)</title>
      <link>https://www.brandonpugh.com/blog/indieweb-movie-club-the-castle-1997/</link>
      <pubDate>Fri, 02 May 2025 00:00:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/indieweb-movie-club-the-castle-1997/</guid>
      <description>&lt;p&gt;I watched &lt;a href=&#34;https://en.wikipedia.org/wiki/The_Castle_%281997_Australian_film%29&#34;&gt;The Castle (1997)&lt;/a&gt; for the &lt;a href=&#34;https://zacharykai.net/notes/iwmapr25&#34;&gt;April&lt;/a&gt; movie club&amp;hellip; great choice &lt;a href=&#34;https://zacharykai.net/&#34;&gt;Zachary Kai&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;In short, I &lt;em&gt;really&lt;/em&gt; enjoyed this film. Go watch it.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll admit the trailer didn&amp;rsquo;t really sell me on it but after watching the first &lt;a href=&#34;https://www.youtube.com/watch?v=IS8SWOXImYg&#34;&gt;eight minutes on YouTube&lt;/a&gt;, I was in.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s about a working-class Australian family that fights to keep their beloved home from being torn down to expand an airport.
The humor is definitely my style with a fast stream of jokes, most of which came from the dialog but there were also some fun visual gags.&lt;/p&gt;
&lt;p&gt;What I especially liked though, was how endearing I found Darryl Kerrigan and his family.
I found myself really admiring how much his family loved and supported each other and how he didn&amp;rsquo;t need much to be content and how he could still marvel at things most of us take for granted&amp;hellip; like power lines.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m glad I discovered this Australian classic and learned a bit more about Australian culture (I now know what &lt;a href=&#34;https://www.youtube.com/watch?v=1IQC3aJCLSE&#34;&gt;Rissoles&lt;/a&gt; are). I haven&amp;rsquo;t seen many Australian comedies, but what I have seen I&amp;rsquo;ve enjoyed, like &lt;a href=&#34;https://www.imdb.com/title/tt18228732/&#34;&gt;Colin from Accounts&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m looking forward to discovering some more gems through the &lt;a href=&#34;https://indieweb.org/IndieWeb_Movie_Club&#34;&gt;Indieweb movie club&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;alternate-version&#34;&gt;Alternate version&lt;/h2&gt;
&lt;p&gt;I rented the movie from Amazon Prime, but having first watched a portion on youtube I noticed some differences in the dialog.&lt;/p&gt;
&lt;p&gt;After some searching, I learned that there is actually an alternate version that replaces certain Australianisms with more American sounding terms or expressions. They had the original cast re-record the lines so it&amp;rsquo;s not very noticeable if you don&amp;rsquo;t know any better. You can see the differences on &lt;a href=&#34;https://www.imdb.com/title/tt0118826/alternateversions/&#34;&gt;IMDB&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;What I found more off-putting was the tweaks to the soundtrack.
For instance, the scene where Steve is showing Darryl his helmet invention has no music in the original but in the American version &lt;a href=&#34;https://youtu.be/5wiF6b4rxno&#34;&gt;All Right Now&lt;/a&gt; is playing which I found rather jarring.
So be sure to watch the original if you can.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/indieweb-movie-club-the-castle-1997/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Indieweb Movie Club - Whats Up Doc (1972)</title>
      <link>https://www.brandonpugh.com/blog/indieweb-movie-club-whats-up-doc-1972/</link>
      <pubDate>Fri, 04 Apr 2025 00:00:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/indieweb-movie-club-whats-up-doc-1972/</guid>
      <description>&lt;p&gt;As part of the &lt;a href=&#34;https://indieweb.org/IndieWeb_Movie_Club&#34;&gt;Indieweb movie club&lt;/a&gt; for &lt;a href=&#34;https://artlung.com/whatsupdoc-imc/&#34;&gt;March&lt;/a&gt;, I watched the 1972 film &lt;a href=&#34;https://www.imdb.com/title/tt0069495/&#34;&gt;What&amp;rsquo;s Up Doc?&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I hadn&amp;rsquo;t heard of this movie before but I ended up having a lot of fun with it.
If you don&amp;rsquo;t mind silly older commedies, then I definitely recommend giving this a watch.&lt;/p&gt;
&lt;p&gt;The film is billed as a &lt;a href=&#34;https://en.wikipedia.org/wiki/Screwball_comedy&#34;&gt;screwball comedy&lt;/a&gt; starring Barbara Streisand and Ryan O&amp;rsquo;Neal.
That&amp;rsquo;s really all you need to know going into it.
I was surprised to learn however, a &amp;ldquo;screwball comedy&amp;rdquo; is actually a very specific sub-genre of romantic commedies dating back to it&amp;rsquo;s peak during the 1940s.
After reading a bit more about it, I realized that this film is a fun homage to the genre and I recognized several of the common tropes such as a &amp;ldquo;one-sided courtship&amp;rdquo;, crazy coincidences, and a classic chase scene to name a few.&lt;/p&gt;
&lt;p&gt;Part of the appeal of watching older movies for me these days, is the glimpse into simpler times they can offer.
For instance, certain gags were almost certainly more impactful back then, such as the &lt;a href=&#34;https://tvtropes.org/pmwiki/pmwiki.php/Main/SheetOfGlass&#34;&gt;sheet of glass&lt;/a&gt; crossing the street, or the car chase down the &lt;a href=&#34;https://en.wikipedia.org/wiki/Lombard_Street_%28San_Francisco%29&#34;&gt;winding Lombard street&lt;/a&gt;. But I found it fascinating to seem them played straight for a change.&lt;/p&gt;
&lt;p&gt;Despite this I still found myself laughing quite a bit.
It was also fun to watch with my mom, a long-time fan of Streisand (a streis-head?), who regaled me with her memories of movies from this time period such as Ryan O&amp;rsquo;Neal&amp;rsquo;s prior film &amp;ldquo;Love Story&amp;rdquo; — which I otherwise wouldn&amp;rsquo;t have realized was being poked fun at with the ending line of this movie.&lt;/p&gt;
&lt;p&gt;So all in all, if you feel like you could use some light-hearted laughs, I recommend it.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/indieweb-movie-club-whats-up-doc-1972/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Anyone can be scammed</title>
      <link>https://www.brandonpugh.com/blog/anyone-can-be-scammed/</link>
      <pubDate>Tue, 25 Mar 2025 00:00:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/anyone-can-be-scammed/</guid>
      <description>&lt;p&gt;Even Troy Hunt (a well-known security researcher and creator of &lt;a href=&#34;https://haveibeenpwned.com/&#34;&gt;Have I Been Pwned&lt;/a&gt;) fell for a phishing email.&lt;br&gt;
He wrote all about it on his blog:
&lt;a href=&#34;https://www.troyhunt.com/a-sneaky-phish-just-grabbed-my-mailchimp-mailing-list/&#34;&gt;A Sneaky Phish Just Grabbed my Mailchimp Mailing List&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I found it a valuable read, not only for the lessons learned, but it&amp;rsquo;s also a reminder that it could have happened to any of us.
The email looks fairly well crafted and I appreciated his analysis of the factors that led to him falling victim.
It&amp;rsquo;s important to remember that even the most security-minded people can make mistakes and that security is hard.&lt;/p&gt;
&lt;p&gt;Honestly the most frustrating part of the story is the fact that Mailchimp doesn&amp;rsquo;t delete unsubscribed emails and even worse they give you no way to opt out of that — so a list owner would have to regularly go in an delete them manually&amp;hellip; and why do they store your IP address?? 😡&lt;/p&gt;
&lt;p&gt;I also thought it was sneaky that they generated an api key on his account. So in addition to updating login credentials remember to check for any recently added api keys.&lt;/p&gt;
&lt;p&gt;I hadn&amp;rsquo;t thought of this vector before, but it&amp;rsquo;s now one more reason why I prefer subscribing via RSS.&lt;/p&gt;
&lt;p&gt;P.S. ButtonDown has a nice &lt;a href=&#34;https://docs.buttondown.com/subscriber-cleanup&#34;&gt;Subscriber cleanup&lt;/a&gt; feature.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/anyone-can-be-scammed/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Git Stash Without the Branch Name</title>
      <link>https://www.brandonpugh.com/blog/git-stash-without-the-branch-name/</link>
      <pubDate>Fri, 28 Feb 2025 14:52:50 -0600</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/git-stash-without-the-branch-name/</guid>
      <description>&lt;p&gt;I found a way to stash changes in git without including the branch name in the stash message.
This might be a very niche use case but it&amp;rsquo;s been a minor annoyance for me for some time.
If you just want the alias, then add the following to your &lt;code&gt;.gitconfig&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;alias&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;sm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;!f() { git stash || exit 1; rev=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;git rev-parse stash@&lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;0&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; &amp;amp;&amp;amp; git stash drop stash@{0} || exit 1; git stash store -m \&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\&amp;#34; &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$rev&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;; }; f&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can also use this technique for renaming stashes.&lt;/p&gt;
&lt;h2 id=&#34;why&#34;&gt;Why?&lt;/h2&gt;
&lt;p&gt;When I stash changes in git, it&amp;rsquo;s usually work that is independent of the branch I&amp;rsquo;m working on.
If I have work in progress that does belong on a particular branch, then I&amp;rsquo;ll create a WIP (&amp;ldquo;work in progress&amp;rdquo;) commit on that branch instead.&lt;/p&gt;
&lt;p&gt;This means that git&amp;rsquo;s default behavior of including the branch name in the stash message just adds noise for me.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;❯  git stash list
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;stash@&lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;0&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;: On feature/get-user-groups: Potential refactor of auth flow
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;stash@&lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;1&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;: On 123-fix-login-bug: disable-dupe-check
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On top of that, most GUI clients show stashes in a sidebar so the important part of the message tends to be cut off.&lt;/p&gt;
&lt;p&gt;Unfortunately there isn&amp;rsquo;t a built-in way to change this behavior but we can get around it with a git alias (formatted for clarity):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;sm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;!f() {
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s2&#34;&gt;    git stash || exit 1;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s2&#34;&gt;    rev=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;git rev-parse stash@&lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;0&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; &amp;amp;&amp;amp; git stash drop stash@{0} || exit 1;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s2&#34;&gt;    git stash store -m \&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;\&amp;#34; &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$rev&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s2&#34;&gt;}; f&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will stash the changes, drop the stash, and then use the &lt;code&gt;stash store&lt;/code&gt; command to create a new stash from the commit of the dropped stash.
The store command won&amp;rsquo;t include the branch name in the message, so running &lt;code&gt;git sm &amp;quot;Potential refactor of auth flow&amp;quot;&lt;/code&gt; will give you:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;❯  git stash list
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;stash@&lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;0&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;: Potential refactor of auth flow
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/git-stash-without-the-branch-name/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Tips for creating merge commits</title>
      <link>https://www.brandonpugh.com/blog/tips-for-creating-merge-commits/</link>
      <pubDate>Sat, 31 Aug 2024 00:00:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/tips-for-creating-merge-commits/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve reviewed quite a few pull requests in recent years and I&amp;rsquo;ve noticed some less-than-ideal practices when it comes to creating merge commits so I thought I&amp;rsquo;d list some things you can do to make life a little easier for someone reviewing your code.&lt;/p&gt;
&lt;h2 id=&#34;make-the-commit-message-as-useful-as-possible&#34;&gt;Make the commit message as useful as possible&lt;/h2&gt;
&lt;p&gt;A lot has been written about &lt;a href=&#34;https://cbea.ms/git-commit/&#34;&gt;how to write good commit messages&lt;/a&gt;, but I rarely see the advice applied to merge commits.
They may not be the most exciting type of commit, but they&amp;rsquo;re still very important.&lt;/p&gt;
&lt;h3 id=&#34;when-merging-prs&#34;&gt;When merging PRs&lt;/h3&gt;
&lt;p&gt;Merge commits that merge a pull request are more straight forward because, these days, they&amp;rsquo;re generally created by the git hosting service so you know they only contain all the changes from that feature branch.&lt;/p&gt;
&lt;p&gt;But you can still make sure they convey the most useful info.
I like the default from Azure DevOps:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Merged PR 123: &amp;lt;PR title&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&amp;lt;PR Description&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can get a similar default in GitHub by configuring the default &lt;a href=&#34;https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-merging-for-pull-requests&#34;&gt;merge commit settings&lt;/a&gt; in the repository settings.
If you&amp;rsquo;re already writing a &lt;a href=&#34;https://www.pullrequest.com/blog/writing-a-great-pull-request-description/&#34;&gt;valuable PR description&lt;/a&gt;, why immortalize it in the repo itself?&lt;/p&gt;
&lt;p&gt;Note: This is even more important for squash merges.&lt;/p&gt;
&lt;h3 id=&#34;for-other-merge-commits&#34;&gt;For other merge commits&lt;/h3&gt;
&lt;p&gt;Now, keep in mind that the need for other merge commits can be mitigated by keeping feature branches small and short-lived, but that&amp;rsquo;s not the reality for a lot of teams.&lt;/p&gt;
&lt;!-- While the need for other merge commits can be mitigated by keeping feature branches small and short-lived, this isn&#39;t always the reality for many teams. --&gt;
&lt;p&gt;For the most part I recommend sticking with the default message that git generates when you run &lt;code&gt;git commit&lt;/code&gt; to complete a merge:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-md&#34; data-lang=&#34;md&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Merge branch &amp;#39;main&amp;#39; into feature-branch
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;# Please enter a commit message to explain why this merge is necessary,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;# especially if it merges an updated upstream into a topic branch.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you notice though, it includes a comment that recommends explaining why the merge was necessary.
This could be something like &amp;ldquo;Merging in updated auth flow&amp;rdquo; or &amp;ldquo;Merging in changes to &lt;code&gt;sharedService&lt;/code&gt; to avoid conflicts&amp;rdquo;.
This also implies that you should have a reason for the merge — which I agree with because otherwise you&amp;rsquo;re adding unnecessary noise to the git log.&lt;/p&gt;
&lt;p&gt;At the very least make it clear that it&amp;rsquo;s a merge commit.
Don&amp;rsquo;t just put something like &lt;code&gt;update database migrations&lt;/code&gt; — if you did have to do that as a result of the merge then mention it in the body of the message (though as I&amp;rsquo;ll explain shortly, it should go in a followup commit).
Otherwise, depending on how you&amp;rsquo;re viewing the git log, it might not be obvious that it&amp;rsquo;s a merge commit.&lt;/p&gt;
&lt;h3 id=&#34;list-conflicts-in-the-commit-message&#34;&gt;List conflicts in the commit message&lt;/h3&gt;
&lt;p&gt;While I personally prefer to rebase branches, one advantage of merging is that it&amp;rsquo;s easier to see how any conflicts were handled.
If there were conflicts during the merge, then git will list the files in the commit message, but they&amp;rsquo;re commented out by default:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-md&#34; data-lang=&#34;md&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Merge branch &amp;#39;main&amp;#39; into feature-branch
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;# Conflicts:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;#	package.json
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;#	package-lock.json
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;#
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;# It looks like you may be committing a merge.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;# If this is not correct, please run
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;#	git update-ref -d MERGE_HEAD
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;# and try again.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can remove the &lt;code&gt;#&lt;/code&gt; from the lines to uncomment them and include them in the commit message.&lt;/p&gt;
&lt;p&gt;As a reviewer, I appreciate this because it&amp;rsquo;s easy to make mistakes when resolving conflicts so if I see files listed then I can scrutinize them more closely.&lt;/p&gt;
&lt;p&gt;You can make it even more convenient by using a &lt;a href=&#34;https://git-scm.com/docs/githooks#_prepare_commit_msg&#34;&gt;&lt;code&gt;prepare-commit-msg&lt;/code&gt;&lt;/a&gt; hook to uncomment them automatically:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;COMMIT_MSG_FILE&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;COMMIT_SOURCE&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$COMMIT_SOURCE&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;merge&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    sed -i.bak &lt;span class=&#34;s1&#34;&gt;&amp;#39;/^# Conflicts:/,/^#$/ s/..//&amp;#39;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$COMMIT_MSG_FILE&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;bonus-use-git-show---remerge-diff-to-see-how-they-were-resolved&#34;&gt;Bonus: use &lt;code&gt;git show --remerge-diff&lt;/code&gt; to see how they were resolved&lt;/h4&gt;
&lt;p&gt;&lt;a href=&#34;https://github.blog/2022-04-18-highlights-from-git-2-36/#review-merge-conflict-resolution-with-remerge-diff&#34;&gt;In Git 2.36&lt;/a&gt;, the &lt;code&gt;--remerge-diff&lt;/code&gt; option was added to &lt;code&gt;git show&lt;/code&gt;.
This makes it easier to see how conflicts were resolved in a merge commit.&lt;/p&gt;
&lt;h2 id=&#34;avoid-evil-merges&#34;&gt;Avoid &amp;ldquo;evil&amp;rdquo; merges&lt;/h2&gt;
&lt;p&gt;An &amp;ldquo;evil&amp;rdquo; merge as defined by the &lt;a href=&#34;https://git-scm.com/docs/gitglossary.html#Documentation/gitglossary.txt-aiddefevilmergeaevilmerge&#34;&gt;git docs&lt;/a&gt; is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;a merge that introduces changes that do not appear in any parent.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;or as Linus himself &lt;a href=&#34;https://www.mail-archive.com/git@vger.kernel.org/msg73938.html&#34;&gt;puts it&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;an &amp;ldquo;evil merge&amp;rdquo; is something that makes changes that came from neither side and aren&amp;rsquo;t actually resolving a conflict&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A merge commit is likely pulling in a large amount of unrelated changes, so it can be hard to notice if you add in your own changes.
I prefer to do the bare minimum to resolve any textual conflicts.&lt;/p&gt;
&lt;p&gt;If there are semantic issues that need to be resolved (i.e. a database view was renamed so my code fails at runtime), then I&amp;rsquo;ll fix them in a separate commit.
This not only makes it easier to review but also makes commands like &lt;code&gt;git blame&lt;/code&gt; more useful.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/tips-for-creating-merge-commits/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>My default apps of 2023</title>
      <link>https://www.brandonpugh.com/blog/my-default-apps-of-2023/</link>
      <pubDate>Sun, 26 Nov 2023 00:00:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/my-default-apps-of-2023/</guid>
      <description>&lt;p&gt;I saw this on &lt;a href=&#34;https://chriscoyier.net/2023/11/25/default-apps-2023/&#34;&gt;Chris Coyier&amp;rsquo;s blog&lt;/a&gt; and thought I would jump on the bandwagon.
&lt;a href=&#34;https://listen.hemisphericviews.com/097&#34;&gt;The idea&lt;/a&gt;, is to see for how many things you use the default apps for your system, which for me is mostly on Android/Google.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s a fun exercise and I totally get the arguments for &amp;ldquo;just&amp;rdquo; using default apps, but I also get a little sad at the thought of huge companies like Apple and Google able beat better alternatives simply because they&amp;rsquo;re the default.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;📨 Mail Client: Gmail&lt;/li&gt;
&lt;li&gt;📮 Mail Server: Google&lt;/li&gt;
&lt;li&gt;📝 Notes: For personal/family stuff &lt;a href=&#34;https://evernote.com&#34;&gt;Evernote&lt;/a&gt; despite looking for alternatives; for technical notes: markdown with &lt;a href=&#34;https://code.visualstudio.com/&#34;&gt;VS Code&lt;/a&gt; and &lt;a href=&#34;https://foambubble.github.io/foam/&#34;&gt;Foam&lt;/a&gt; family of extensions.&lt;/li&gt;
&lt;li&gt;✅ To-Do: &lt;a href=&#34;https://www.rememberthemilk.com/&#34;&gt;Remember the Milk&lt;/a&gt; - I&amp;rsquo;ve been using it since 2008 and I still like it better than all the others I&amp;rsquo;ve tried.&lt;/li&gt;
&lt;li&gt;📷 Photo Shooting: Pixel Phone camera&lt;/li&gt;
&lt;li&gt;🎨 Photo Editing: Google Photos&lt;/li&gt;
&lt;li&gt;📆 Calendar: Google Calendar&lt;/li&gt;
&lt;li&gt;📁 Cloud File Storage: Google Drive&lt;/li&gt;
&lt;li&gt;📖 RSS: &lt;a href=&#34;https://inoreader.com/&#34;&gt;Inoreader&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;🙍🏻‍♂️ Contacts: Google contacts&lt;/li&gt;
&lt;li&gt;🌐 Browser: Chrome&lt;/li&gt;
&lt;li&gt;💬 Chat: Slack&lt;/li&gt;
&lt;li&gt;🔖 Bookmarks: &lt;a href=&#34;https://pinboard.in&#34;&gt;Pinboard&lt;/a&gt; including their awesome archival service&lt;/li&gt;
&lt;li&gt;📑 Read It Later: &lt;a href=&#34;https://getpocket.com&#34;&gt;Pocket&lt;/a&gt; (don&amp;rsquo;t ask how many unread articles I have 😬)&lt;/li&gt;
&lt;li&gt;📜 Word Processing: Google Docs&lt;/li&gt;
&lt;li&gt;📈 Spreadsheets: Google Sheets&lt;/li&gt;
&lt;li&gt;📊 Presentations: &lt;a href=&#34;https://revealjs.com/&#34;&gt;Reveal.js&lt;/a&gt; and specifically &lt;a href=&#34;https://github.com/webpro/reveal-md&#34;&gt;reveal-md&lt;/a&gt; is the best tool I&amp;rsquo;ve found for slides with code snippets.&lt;/li&gt;
&lt;li&gt;🛒 Shopping Lists: &lt;a href=&#34;https://www.rememberthemilk.com/&#34;&gt;Remember the Milk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;🍴 Meal Planning: N/A&lt;/li&gt;
&lt;li&gt;💰 Budgeting and Personal Finance: &lt;a href=&#34;https://mint.intuit.com/&#34;&gt;Mint&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;📰 News: &lt;a href=&#34;https://inoreader.com/&#34;&gt;Inoreader&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;🎵 Music: Youtube Music&lt;/li&gt;
&lt;li&gt;🎤 Podcasts: &lt;a href=&#34;https://pocketcasts.com/&#34;&gt;Pocket Casts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;🔐 Password Management: &lt;a href=&#34;https://1password.com/&#34;&gt;1Password&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;🧑‍💻 Code Editor: &lt;a href=&#34;https://code.visualstudio.com/&#34;&gt;VS Code&lt;/a&gt; and &lt;a href=&#34;https://neovim.io/&#34;&gt;Neovim&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;✈️ VPN: &lt;a href=&#34;https://mullvad.net&#34;&gt;Mullvad VPN&lt;/a&gt; and &lt;a href=&#34;https://tailscale.com/&#34;&gt;Tailscale&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/my-default-apps-of-2023/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Blazor Best Practices Borrowed From React</title>
      <link>https://www.brandonpugh.com/blog/blazor-best-practices/</link>
      <pubDate>Mon, 19 Dec 2022 10:54:24 +0200</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/blazor-best-practices/</guid>
      <description>&lt;p&gt;Blazor took a lot of design decisions from React and other frontend frameworks and as a stateful component-based UI framework there is quite a bit of experience that can be transferred from one to the other.&lt;/p&gt;
&lt;p&gt;I gave this talk earlier this year at KCDC and then last week I presented an updated version as a Jetbrains webinar. Special thanks to &lt;a href=&#34;https://khalidabuhakmeh.com/&#34;&gt;Khalid&lt;/a&gt; for inviting me on and being an excellent host!&lt;/p&gt;
&lt;p&gt;I hope to write up the content in a more in depth post sometime soon, but in the mean time you can watch the recording on &lt;a href=&#34;https://www.youtube.com/watch?v=q7qgSzAALLg&#34;&gt;Youtube&lt;/a&gt; and view the slides at &lt;a href=&#34;https://www.brandonpugh.com/blazor-talk/#/&#34;&gt;brandonpugh.com/blazor-talk&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Some of the points I cover:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;State management&lt;/li&gt;
&lt;li&gt;Reusable components&lt;/li&gt;
&lt;li&gt;Accessibility&lt;/li&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;
      &lt;iframe allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen&#34; loading=&#34;eager&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; src=&#34;https://www.youtube.com/embed/q7qgSzAALLg?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; title=&#34;YouTube video&#34;&gt;&lt;/iframe&gt;
    &lt;/div&gt;

&lt;a href=&#34;https://www.youtube.com/watch?v=q7qgSzAALLg&#34;&gt;Blazor Best Practices Borrowed from React&lt;/a&gt;&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/blazor-best-practices/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>An Assortment of Productivity Tips</title>
      <link>https://www.brandonpugh.com/blog/an-assortment-of-productivity-tips/</link>
      <pubDate>Sat, 19 Mar 2022 00:00:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/an-assortment-of-productivity-tips/</guid>
      <description>&lt;p&gt;I recently gave a lunch-n-learn at work on productivity.
This is brief a overview of the points from the talk and little tips for saving time or being more efficient while doing knowledge work.&lt;/p&gt;
&lt;h2 id=&#34;organization-vs-execution&#34;&gt;Organization vs Execution&lt;/h2&gt;
&lt;p&gt;To me most productivity advice either falls under &amp;ldquo;organization&amp;rdquo; or &amp;ldquo;execution&amp;rdquo;. Organization being advice like &amp;ldquo;create task lists&amp;rdquo;, &amp;ldquo;process your inboxes&amp;rdquo;, etc. I could write a whole separate post just this category. Whereas execution is all about finding the time to actually do the tasks that are on your plate.&lt;/p&gt;
&lt;h3 id=&#34;attention-and-focus&#34;&gt;Attention and Focus&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;ve noticed that a lot of the advice on the execution side is really boils down to managing your attention and focus.
And what&amp;rsquo;s fascinating is that a lot of the most popular advice and techniques just deal with focus and different levels of abstraction.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mindfullness Meditation&lt;/li&gt;
&lt;li&gt;Pomodoro Technique&lt;/li&gt;
&lt;li&gt;Time-block planning / scheduling&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;so-many-techniques&#34;&gt;So many techniques&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://todoist.com/productivity-methods&#34;&gt;Todoist Productivity method quiz&lt;/a&gt; - to explore various productivity methods that might fit your style.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In my post on &lt;a href=&#34;https://www.brandonpugh.com/blog/2019/08/getting-things-done-as-team-lead/&#34;&gt;how I get things done as a tech lead&lt;/a&gt;, I talk about the methods I use. It&amp;rsquo;s mostly still the same today though use &lt;a href=&#34;https://www.calnewport.com/blog/2013/12/21/deep-habits-the-importance-of-planning-every-minute-of-your-work-day/&#34;&gt;time block planning&lt;/a&gt; a lot more.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Don&amp;rsquo;t live life by default - &lt;a href=&#34;https://www.hanselman.com/blog/relationship-hacks-mindfulness-dont-live-your-life-by-default&#34;&gt;Scott Hanselman&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&#34;avoid-distractions&#34;&gt;Avoid Distractions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Use focus mode on Android or iOS&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://slack.com/help/articles/214908388-Pause-notifications-with-Do-Not-Disturb&#34;&gt;Slack dnd&lt;/a&gt; (You can type &lt;code&gt;/dnd&lt;/code&gt; in any chat to start)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://nohello.net/&#34;&gt;no hello&lt;/a&gt; - to respect colleagues attention&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://chrome.google.com/webstore/detail/youtube-rabbit-hole/nlddakjbmpidooplakalfoogdincflfh&#34;&gt;YouTube Rabbit Hole&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;always-be-learning&#34;&gt;Always be Learning&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Newsletters for different technologies and communities
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://cooperpress.com/publications/&#34;&gt;https://cooperpress.com/publications/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://blog.cwa.me.uk/&#34;&gt;The Morning Brew&lt;/a&gt; - for .Net&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.alvinashcraft.com/&#34;&gt;The Morning Dew&lt;/a&gt; - for .Net and web if you like drinking from the firehose&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://getpocket.com&#34;&gt;Pocket&lt;/a&gt; - for saving articles to read later&lt;/li&gt;
&lt;li&gt;If you have lots of internal presentations or meeting recordings to watch, import them into a podcast app
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.pocketcasts.com/&#34;&gt;PocketCasts&lt;/a&gt; - my favorite podcast app&lt;/li&gt;
&lt;li&gt;change playback speed, remember play position, listen to audio while folding laundry&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://kill-the-newsletter.com/&#34;&gt;https://kill-the-newsletter.com/&lt;/a&gt; - to consume newsletters as an rss feed&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.youtube.com/premium&#34;&gt;Youtube Premium&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;totally worth it IMHO&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No ads!&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Offline downloads and background listening on mobile&lt;/li&gt;
&lt;li&gt;Creators get paid for your views&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.inoreader.com/&#34;&gt;Inoreader&lt;/a&gt; - my favorite rss reader&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;avoid-the-mouse-and-save-your-keystrokes&#34;&gt;Avoid the mouse and save your keystrokes&lt;/h2&gt;
&lt;p&gt;You only have so much time and &lt;a href=&#34;https://keysleft.com/&#34;&gt;keystrokes left&lt;/a&gt; so in general, &lt;a href=&#34;https://www.asianefficiency.com/productivity/5-ways-to-automate-technology-and-save-time/&#34;&gt;automate as much as possible.&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pressing &lt;code&gt;Ctrl + Backspace&lt;/code&gt; will delete the last word you typed&lt;/li&gt;
&lt;li&gt;speed up informational videos (&lt;code&gt;&amp;lt; &amp;gt;&lt;/code&gt; youtube keyboard shortcuts)&lt;/li&gt;
&lt;li&gt;use markdown-like shortcuts in google docs, confluence, slack, etc.&lt;/li&gt;
&lt;li&gt;global hotkeys
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;win+.&lt;/code&gt; windows emoji picker&lt;/li&gt;
&lt;li&gt;&lt;code&gt;alt+a&lt;/code&gt; mute in zoom (change setting to make this global)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;alt+tab&lt;/code&gt; or &lt;code&gt;command+tab&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;alt+f4&lt;/code&gt; to close a window&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;remap-keys&#34;&gt;Remap keys&lt;/h4&gt;
&lt;p&gt;If you find a keyboard key or hotkey that you use frequently but it&amp;rsquo;s awkward to type then you should use a utility to remap it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.autohotkey.com/&#34;&gt;autohotkey&lt;/a&gt; or &lt;a href=&#34;https://docs.microsoft.com/en-us/windows/powertoys/&#34;&gt;Microsoft powertoys&lt;/a&gt; (windows)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://karabiner-elements.pqrs.org/&#34;&gt;Karabiner-elements&lt;/a&gt; (mac)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some I use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;remap &lt;code&gt;capslock&lt;/code&gt; key
&lt;ul&gt;
&lt;li&gt;a lot of people map it to &lt;code&gt;ctrl&lt;/code&gt; but I personally do &lt;code&gt;esc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;you can map &lt;code&gt;shift+capslock&lt;/code&gt; to capslock if you still want that functionality&lt;/li&gt;
&lt;li&gt;have a look at &lt;a href=&#34;https://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/&#34;&gt;A useful Caps Lock key&lt;/a&gt; if you&amp;rsquo;re on mac&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;remap &lt;code&gt;alt+f4&lt;/code&gt; to &lt;code&gt;capslock+q&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;capslock+n&lt;/code&gt; is backspace since I was getting RSI from reaching for backspace button so frequently&lt;/li&gt;
&lt;li&gt;&lt;code&gt;capslock&lt;/code&gt; + &lt;code&gt;h&lt;/code&gt;,&lt;code&gt;j&lt;/code&gt;,&lt;code&gt;k&lt;/code&gt;,or&lt;code&gt;l&lt;/code&gt; remapped to &lt;code&gt;←&lt;/code&gt;,&lt;code&gt;↓&lt;/code&gt;,&lt;code&gt;↑&lt;/code&gt;,&lt;code&gt;→&lt;/code&gt; to mimic simple vim key bindings &lt;!-- found these unicode arrows here: https://unicode.org/charts/nameslist/n_2190.html --&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;capslock+{1|2}&lt;/code&gt; for switching between &lt;a href=&#34;https://www.howtogeek.com/197625/how-to-use-virtual-desktops-in-windows-10&#34;&gt;virtual desktops&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In his &lt;a href=&#34;https://www.hillelwayne.com/post/ahk/&#34;&gt;post on autohotkey&lt;/a&gt;, Hillel Wayne talks about fast window switching by creating hotkeys to pull up specific apps. These are some of the ones I have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;win+z&lt;/code&gt; - zoom&lt;/li&gt;
&lt;li&gt;&lt;code&gt;win+w&lt;/code&gt; - browser windows&lt;/li&gt;
&lt;li&gt;&lt;code&gt;win+c&lt;/code&gt; - code editor&lt;/li&gt;
&lt;li&gt;&lt;code&gt;win+backtick&lt;/code&gt; - terminal&lt;/li&gt;
&lt;li&gt;&lt;code&gt;win+s&lt;/code&gt; - slack&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On windows you can achieve something similar by pinning apps to the taskbar and using the &lt;a href=&#34;https://www.howtogeek.com/276982/the-most-useful-keyboard-shortcuts-for-the-windows-taskbar/&#34;&gt;built-in taskbar hotkeys.&lt;/a&gt;. I think you can do this with &lt;a href=&#34;https://www.alfredapp.com/&#34;&gt;Alfred&lt;/a&gt; on mac.&lt;/p&gt;
&lt;h3 id=&#34;text-expansion&#34;&gt;Text expansion&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;ve only been using a text expansion app the last couple of years but I regret not starting sooner because it&amp;rsquo;s a game changer!
There are tons of potential ways it can save you time but here are some of the ones I use the most:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;personal info like email addresses or phone numbers&lt;/li&gt;
&lt;li&gt;things you type all the time like client/company/project names&lt;/li&gt;
&lt;li&gt;hard to type characters or words&lt;/li&gt;
&lt;li&gt;text utilities like typing out the current date&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are lots free/paid text expanders but I like &lt;a href=&#34;https://espanso.org/&#34;&gt;Espanso&lt;/a&gt; because it&amp;rsquo;s cross-platform and open source and you configure it entirely with a yaml config file. I could probably write an entire post on my espanso setup.
But there are lots of alternatives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;macOS has &lt;a href=&#34;https://support.apple.com/guide/mac-help/replace-text-punctuation-documents-mac-mh35735/mac&#34;&gt;built-in basic text replacement&lt;/a&gt; functionality&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://textexpander.com/&#34;&gt;TextExpander&lt;/a&gt; is by far the most popular solution&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.phraseexpress.com/&#34;&gt;PhraseExpress&lt;/a&gt; is free for personal use&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also use a key remapper like autohotkey for text expansion with a bit more manual effort.&lt;/p&gt;
&lt;h3 id=&#34;misc&#34;&gt;Misc&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;enable clipboard history (native in Windows) &lt;code&gt;win+v&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://sabrogden.github.io/Ditto/&#34;&gt;Ditto&lt;/a&gt; for more features&lt;/li&gt;
&lt;li&gt;Alfred on mac&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://support.google.com/a/users/answer/9310144?hl=en&#34;&gt;chrome profiles&lt;/a&gt; for different personalities&lt;/li&gt;
&lt;li&gt;setup &lt;a href=&#34;https://zapier.com/blog/add-search-engine-to-chrome/&#34;&gt;custom searches in Chrome&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Microsoft powertoys adds some very handy functionality
&lt;ul&gt;
&lt;li&gt;always on top&lt;/li&gt;
&lt;li&gt;always awake&lt;/li&gt;
&lt;li&gt;global mute (&lt;code&gt;win+shift+a&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;command palette (&lt;a href=&#34;https://www.alfredapp.com/&#34;&gt;alfred&lt;/a&gt; on mac)&lt;/li&gt;
&lt;li&gt;key remapper&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;for-developers&#34;&gt;For developers&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;log files with &lt;code&gt;.log&lt;/code&gt; extension will have nice syntax highlighting when opened in vscode&lt;/li&gt;
&lt;li&gt;vscode terminal will open file paths in editor&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.hanselman.com/blog/how-to-create-a-file-with-a-dot-prefix-in-windows-explorer&#34;&gt;learn how to create a file with a . dot prefix in Windows Explorer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;make use of shell/git and aliases&lt;/li&gt;
&lt;li&gt;powershell tools
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/dahlbyk/posh-git&#34;&gt;posh-git&lt;/a&gt; - nice git integration&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/vors/ZLocation&#34;&gt;z-location&lt;/a&gt; - jump to frequently used directories&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/kelleyma49/PSFzf&#34;&gt;PSFzf&lt;/a&gt; - powershell wrapper around fzf (fuzzy file finder)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;powershell-aliases&#34;&gt;Powershell aliases&lt;/h3&gt;
&lt;p&gt;I have a bunch of these just to save me a few keystrokes by not having to type &lt;code&gt;git&lt;/code&gt; in from of my most-used git aliases.
I mostly use powershell these days but most shells have similar capabilities.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;# Git helpers&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;Function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;st&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;git&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;st&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$args&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;Function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;stand&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;git&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;standup&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$args&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;Function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;ci&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;git&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ci&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$args&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;Function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;cia&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;git&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ci&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;-amend&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$args&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;Function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;rsh&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;git&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;reset&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;-hard&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$args&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;Function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;git&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pr&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$args&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;Function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;ri&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;git&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rebase&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;-i&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$args&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;# Runners&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;Function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;nr&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;npm&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;run&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$args&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;Function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;dn&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;dotnet&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;watch&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$args&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;# leverage PSFzf&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;Function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;fsa&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;Invoke-FuzzyGitStatus&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;%&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;git&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;add&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$_&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;# list and execute psake tasks for a specific project from any directory&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;Function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;fp&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;Get-PSakeScriptTasks&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;-BuildFile&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;\&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;\&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;to&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;\&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;project&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;\&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;psakefile&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;py&#34;&gt;ps1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Invoke-Fzf&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;%&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Invoke-PSake&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$_&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;automate-machine-setup&#34;&gt;Automate machine setup&lt;/h2&gt;
&lt;p&gt;Now that you&amp;rsquo;ve optimized your setup and are in the habit of making tweaks and optimizations as the need arises, you should make sure it&amp;rsquo;s easily repeatable when you have to change machines.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://ninite.com/&#34;&gt;Ninite&lt;/a&gt; quick and easy GUI app for installing some common apps&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://chocolatey.org/&#34;&gt;Chocolatey&lt;/a&gt; or &lt;a href=&#34;https://docs.microsoft.com/en-us/windows/package-manager/winget/&#34;&gt;winget&lt;/a&gt; (windows) or &lt;a href=&#34;https://brew.sh/&#34;&gt;homebrew&lt;/a&gt; (mac)&lt;/li&gt;
&lt;li&gt;Create a &lt;a href=&#34;https://blog.danslimmon.com/2019/07/15/do-nothing-scripting-the-key-to-gradual-automation/&#34;&gt;do nothing script&lt;/a&gt; to document any tasks that can&amp;rsquo;t be automated yet&lt;/li&gt;
&lt;li&gt;sync your config files or scripts &lt;a href=&#34;https://www.atlassian.com/git/tutorials/dotfiles&#34;&gt;with git&lt;/a&gt; or &lt;a href=&#34;https://syncthing.net/&#34;&gt;Syncthing&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/an-assortment-of-productivity-tips/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Git Config Settings I Always Recommend</title>
      <link>https://www.brandonpugh.com/blog/git-config-settings-i-always-recommend/</link>
      <pubDate>Sat, 05 Mar 2022 00:00:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/git-config-settings-i-always-recommend/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;ve ever worked on a project with me then I&amp;rsquo;ve probably recommended at least one of these config settings in git.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git config --global pull.rebase true&lt;/code&gt; - tells git to always pull with rebase instead of merge (the equivalent of &lt;code&gt;pull --rebase&lt;/code&gt;).
This not only saves you having to type the flag every time, but also ensures gui clients will also use rebase when pulling.
&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/em&gt; You should only enable this if you&amp;rsquo;re comfortable with rebasing.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git config --global fetch.prune true&lt;/code&gt; - tells git to automatically run &lt;code&gt;git remote prune&lt;/code&gt; after a &lt;code&gt;fetch&lt;/code&gt;. This will clean up any local objects that no longer exist on the remote like tracking branches that have been deleted from the remote server.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git config --global rebase.autoStash true&lt;/code&gt; - tells git to automatically stash when you perform a pull and then attempt to unstash them once the rebase is complete. This is almost always my workflow so it&amp;rsquo;s nice to have git do it for me.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git config --global rebase.autosquash true&lt;/code&gt; - tells git to automatically include the &lt;code&gt;--autosquash&lt;/code&gt; parameter when doing a &lt;code&gt;git rebase --interactive&lt;/code&gt;. You should &lt;a href=&#34;https://thoughtbot.com/blog/autosquashing-git-commits&#34;&gt;read more about autosquashing&lt;/a&gt; commits if you&amp;rsquo;re unfamiliar with it. I use it all the time for fixing up or rewording previous commits.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;newer-settings&#34;&gt;Newer settings&lt;/h2&gt;
&lt;p&gt;If you haven&amp;rsquo;t updated git in a couple years then you should as it&amp;rsquo;s worth it just for these new config options.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git config --global push.useForceIfIncludes true&lt;/code&gt; (2.30.0) - This setting makes &lt;code&gt;push --force-with-lease&lt;/code&gt; even safer by ensuring the tip of the remote was actually pulled into your local branch at some point. &lt;a href=&#34;https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-force-if-includes&#34;&gt;See the docs&lt;/a&gt; for more info.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git config --global push.autoSetupRemote true&lt;/code&gt; (2.37.0) - Git will automatically setup an upsteam tracking when you run &lt;code&gt;git push&lt;/code&gt; from a new branch.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git config --global rebase.updateRefs true&lt;/code&gt; (2.38.0) - the &lt;code&gt;--update-refs&lt;/code&gt; option &lt;a href=&#34;https://andrewlock.net/working-with-stacked-branches-in-git-is-easier-with-update-refs/&#34;&gt;makes working with stacked branches easier&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;personal-preference&#34;&gt;Personal preference&lt;/h2&gt;
&lt;p&gt;You might find these useful depending on your personal workflow.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git config --global commit.verbose true&lt;/code&gt; - Git will include the diff of the changes at the bottom of the commit message template. I like this because your text editor can then autocomplete variable or function names you want to include in the commit message.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git config --global rerere.enabled true&lt;/code&gt; - It stands for Reuse Recorded Resolution, and tells Git to remember how you resolved a merge conflict and automatically reapply if it sees it again.&lt;/li&gt;
&lt;/ul&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/git-config-settings-i-always-recommend/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>How I get things done as a tech lead</title>
      <link>https://www.brandonpugh.com/blog/getting-things-done-as-team-lead/</link>
      <pubDate>Sun, 04 Aug 2019 10:54:24 +0200</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/getting-things-done-as-team-lead/</guid>
      <description>&lt;p&gt;I&amp;rsquo;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.&lt;/p&gt;
&lt;p&gt;As an individual contributor on a dev team, decisions about what you should be working on are mostly made for you. You pick up tasks from the sprint board or tackle tickets as they&amp;rsquo;re assigned to you. Tech leads&amp;rsquo; tasks tend to be much more fluid and it&amp;rsquo;s usually up to you to track them in addition to what the rest of the team is working on. That being said there should still be plenty to take away from this post for non tech leads as well.&lt;/p&gt;
&lt;p&gt;None of these ideas are really original or groundbreaking. This is more of a collection of tips, hacks, and recommendations from various productivity systems I&amp;rsquo;ve read about over the years.&lt;/p&gt;
&lt;h3 id=&#34;write-everything-down&#34;&gt;Write Everything Down&lt;/h3&gt;
&lt;p&gt;Capture everything! The less you try to hold in your head the more you free up your brain to be creative and focus solely on the task at hand. This especially applies to action items. As a lead you&amp;rsquo;re much more likely to be given random tasks at random times&amp;hellip; while walking out of a meeting, in a comment on a JIRA ticket you need to follow up on, or during a quick call with a product owner.&lt;/p&gt;
&lt;p&gt;To be able to handle this effectively you need a task management system that let&amp;rsquo;s you quickly jot things at any time. There are approximately a million todo/tasks/list/note app available so you should be able to find one that works for you but I would recommend one that allows quick entry from both desktop and mobile. I&amp;rsquo;ve personally been using &lt;a href=&#34;https://www.rememberthemilk.com&#34;&gt;Remember the Milk&lt;/a&gt; since 2007.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re able to build this habit then everyone you work with will start to build a trust in you that tasks they delegate won&amp;rsquo;t fall through the cracks if they don&amp;rsquo;t remember to follow up with you.&lt;/p&gt;
&lt;h3 id=&#34;attention-management&#34;&gt;Attention Management&lt;/h3&gt;
&lt;p&gt;A lot has already been written on the importance of minimizing distractions and focusing on a single task at a time so I won&amp;rsquo;t rehash it here, but I&amp;rsquo;ve found that how I manage my attention to be a key factor in how productive my day is. This is so important in fact that my company invested in several hours of mandatory training for everyone on the topic.&lt;/p&gt;
&lt;p&gt;As leader part of our job is doing what we can to make our team as a whole more productive, so we don&amp;rsquo;t always have the luxury of tuning out all distractions entirely but there are things you can do make it easier.&lt;/p&gt;
&lt;h4 id=&#34;create-focus-blocks&#34;&gt;Create focus blocks&lt;/h4&gt;
&lt;p&gt;Try to create dedicated blocks of time where you can focus and get into a flow. For me, some variation of the &lt;a href=&#34;https://lifehacker.com/productivity-101-a-primer-to-the-pomodoro-technique-1598992730&#34;&gt;pomodoro technique&lt;/a&gt; has worked really well. &lt;a href=&#34;https://www.softwaremeadows.com/posts/the_50-10_time_box_revising_pomodoro_for_software_development_repost/&#34;&gt;This post&lt;/a&gt; does a great job of describing a way to apply it to development work as well as explaining how interruptions are especially bad for technical work.&lt;/p&gt;
&lt;p&gt;Making use of Slack&amp;rsquo;s &amp;ldquo;Do Not Disturb&amp;rdquo; mode is great way to minimize distractions during these blocks. It effectively pauses all notifications from slack until DND is disabled at which point Slack let&amp;rsquo;s you know if you missed any messages, but also when someone messages you slack will give them the option to push the message through anyway if it&amp;rsquo;s urgent. You just need to let your team know what types of things are ok to push through. For me, if anyone is completely blocked waiting on something from me then I&amp;rsquo;m fine being interrupted to unblock them.&lt;/p&gt;
&lt;p&gt;In general it&amp;rsquo;s a good idea to &lt;a href=&#34;https://blog.rescuetime.com/slack-focus-guide/&#34;&gt;adjust your notification settings&lt;/a&gt; in whatever apps you use.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s helpful to have some way to easily jot down any thoughts or ideas that pop up so your brain can quickly return focus to the task at hand since it knows the idea was captured and you can address it later. If I&amp;rsquo;m working on a particular feature or reviewing a pull request, I can easily distract myself if I notice an unrelated bug or have an idea to improve some development process around this area of code and before I know it I&amp;rsquo;m down a rabbit hole 5 - 8 browser tabs deep. But if I know I&amp;rsquo;ve dedicated this block of time to a particular task, then it&amp;rsquo;s much easier to catch myself and instead capture the item quickly and then decided how to handle it once this block is over.&lt;/p&gt;
&lt;h3 id=&#34;most-important-tasks&#34;&gt;Most Important Tasks&lt;/h3&gt;
&lt;p&gt;Identify your &lt;a href=&#34;https://zenhabits.net/purpose-your-day-most-important-task/&#34;&gt;most important tasks&lt;/a&gt; for the day and try to tackle these first thing in the morning or whenever you tend to have the most energy and willpower. This is definitely not a new concept but it&amp;rsquo;s one I&amp;rsquo;ve relied on more while in a leadership role where I have more non-technical tasks that I tend to put off or still feel less comfortable doing. For instance, this technique helped me finally finish my team&amp;rsquo;s performance evaluations even while seemly more urgent tasks regularly popped up throughout my day.&lt;/p&gt;
&lt;h3 id=&#34;weekly-review&#34;&gt;Weekly review&lt;/h3&gt;
&lt;p&gt;Having a &lt;a href=&#34;https://lifehacker.com/the-weekly-review-how-one-hour-can-save-you-a-week-s-w-5908816&#34;&gt;weekly review&lt;/a&gt; has become an invaluable practice I picked up from the &lt;a href=&#34;https://www.amazon.com/Getting-Things-Done-Stress-Free-Productivity-ebook/dp/B00KWG9M2E/ref=as_li_ss_tl?_encoding=UTF8&amp;amp;qid=&amp;amp;sr=&amp;amp;linkCode=ll1&amp;amp;tag=bpugh07-20&amp;amp;linkId=a38d0a77a5ff8b08049aef248af8b5cc&amp;amp;language=en_US&#34;&gt;Getting Things Done&lt;/a&gt; system. In terms of agile processes you can think of it as sprint planning and retrospective. You should set a focus block on your calendar and use it as a time plan and prepare for the week ahead as well as reflect on the previous week.&lt;/p&gt;
&lt;p&gt;I use it to process all my &amp;ldquo;inboxes&amp;rdquo; including email, chat messages, unsorted notes, various todo lists, and even open browser tabs. I also check my calendar for the next week for upcoming deadlines or meetings scheduled that require additional preparation.&lt;/p&gt;
&lt;h3 id=&#34;summary&#34;&gt;Summary&lt;/h3&gt;
&lt;p&gt;We all have our own ways of working that work best for us, and I&amp;rsquo;m constantly tweaking my workflows but these techniques have been serving me well for a while now so hopefully you found at least one helpful takeaway you can apply to your own work.
I may even write a follow up post that goes into more of the implementation details of my system, like tools and processes, if there is any interest.&lt;/p&gt;
&lt;h3 id=&#34;further-reading&#34;&gt;Further Reading&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.amazon.com/Getting-Things-Done-Stress-Free-Productivity-ebook/dp/B00KWG9M2E/ref=as_li_ss_tl?_encoding=UTF8&amp;amp;qid=&amp;amp;sr=&amp;amp;linkCode=ll1&amp;amp;tag=bpugh07-20&amp;amp;linkId=a38d0a77a5ff8b08049aef248af8b5cc&amp;amp;language=en_US&#34;&gt;Getting Things Done&lt;/a&gt; (GTD) by David Allen&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.amazon.com/Deep-Work-Focused-Success-Distracted-ebook/dp/B00X47ZVXM/ref=sr_1_3?keywords=deep&amp;#43;work&amp;amp;qid=1564377876&amp;amp;s=digital-text&amp;amp;sr=1-3&#34;&gt;Deep Work&lt;/a&gt; by Cal Newport&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://amzn.to/31hnYLe&#34;&gt;Hyperfocus&lt;/a&gt; by Chris Bailey&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://amzn.to/2YILcs3&#34;&gt;The Manager&amp;rsquo;s Path&lt;/a&gt; by Camille Fournier -&amp;gt; a great book in general on technical leadership&lt;/li&gt;
&lt;/ul&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/getting-things-done-as-team-lead/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>My Always-Up-to-Date VS Code Setup for Web Development</title>
      <link>https://www.brandonpugh.com/blog/vscode-setup/</link>
      <pubDate>Sat, 29 Jun 2019 10:54:24 +0200</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/vscode-setup/</guid>
      <description>&lt;p&gt;I&amp;rsquo;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.&lt;/p&gt;
&lt;p&gt;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 &lt;em&gt;the best&lt;/em&gt; experience while writing javascript.&lt;/p&gt;
&lt;h2 id=&#34;extensions&#34;&gt;Extensions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig&#34;&gt;EditorConfig&lt;/a&gt;: See &lt;a href=&#34;http://editorconfig.org/&#34;&gt;http://editorconfig.org/&lt;/a&gt; if you don&amp;rsquo;t already have a &lt;code&gt;.editorconfig&lt;/code&gt; file in your project&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode&#34;&gt;Prettier&lt;/a&gt;: format javascript using the excellent new &lt;a href=&#34;https://github.com/jlongster/prettier&#34;&gt;Prettier&lt;/a&gt; project by &lt;a href=&#34;http://jlongster.com/&#34;&gt;James Long&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint&#34;&gt;Eslint&lt;/a&gt;: Integrates &lt;a href=&#34;https://eslint.org/&#34;&gt;ESLint&lt;/a&gt; JavaScript linter into VS Code&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens&#34;&gt;GitLens&lt;/a&gt;: adds quite a bit of functionality over the builtin git experience in with the free version.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=yoavbls.pretty-ts-errors&#34;&gt;Pretty Typescript Errors&lt;/a&gt;: Makes typescript errors &lt;em&gt;much&lt;/em&gt; more readable in VS Code—really should be built-in&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest&#34;&gt;Jest&lt;/a&gt;: Integration for the &lt;a href=&#34;https://facebook.github.io/jest/&#34;&gt;Jest&lt;/a&gt; testing framework&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=vitest.explorer&#34;&gt;Vitest&lt;/a&gt;: Since I&amp;rsquo;m using Vite these days, I prefer &lt;a href=&#34;https://vitest.dev/&#34;&gt;Vitest&lt;/a&gt; over Jest and this is their vscode integration.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=andys8.jest-snippets&#34;&gt;Jest Snippets&lt;/a&gt;: Common code snippets for unit tests&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker&#34;&gt;Code Spell Checker&lt;/a&gt;: An excellent spell checker that works well with camelCase code&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense&#34;&gt;Path Intellisense&lt;/a&gt;: Autocompletes filenames, handy when typing paths to import modules&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=pflannery.vscode-versionlens&#34;&gt;Version Lens&lt;/a&gt;: Shows the latest version for each dependency in your &lt;code&gt;package.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint&#34;&gt;Markdownlint&lt;/a&gt;: Markdown linting and style checking for Visual Studio Code. Handy for editing Readme files&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=shinnn.stylelint&#34;&gt;Stylelint&lt;/a&gt;: Modern CSS/SCSS/Less linter&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=vscode-icons-team.vscode-icons&#34;&gt;vscode-icons&lt;/a&gt;: Very extensive set of icons for just about every file type imaginable. You could consider it purely aesthetics, but I find have distinct icons makes it easier at a glance to find certain files i.e. a different icon for a &lt;code&gt;spec.js&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock&#34;&gt;Peacock&lt;/a&gt;: Subtly change the workspace color of your workspace. Ideal when you have multiple VS Code instances and you want to quickly identify which is which&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;react-specific&#34;&gt;React Specific&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=gottfired.css2react&#34;&gt;css2React&lt;/a&gt;: Convert selection between CSS and React inline style syntax and vice versa&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets&#34;&gt;ES7+ React/Redux/React-Native snippets&lt;/a&gt;: The name says it all. See the full list of &lt;a href=&#34;https://github.com/ults-io/vscode-react-javascript-snippets/blob/master/docs/Snippets.md&#34;&gt;snippets here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=team-sapling.sapling&#34;&gt;Sapling&lt;/a&gt;: Creates an interactive component dependency tree embedded within the VS Code sidebar&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;angular-specific&#34;&gt;Angular Specific&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Update: It&amp;rsquo;s been a while now since I&amp;rsquo;ve been on an Angular project so I can&amp;rsquo;t really speak to whether these are still the best options but I&amp;rsquo;m leaving them here in case they&amp;rsquo;re still useful.&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=Angular.ng-template&#34;&gt;Angular Language Service&lt;/a&gt;: Rich editing support for Angular html templates&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=natewallace.angular2-inline&#34;&gt;Angular2 inline&lt;/a&gt;: Syntax highlighting for Angular inline templates&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=johnpapa.Angular2&amp;amp;wt.mc_id=angularessentials-github-jopapa&#34;&gt;Angular snippets&lt;/a&gt;: Angular v8 snippets&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=PKief.angular-component-extractor&#34;&gt;Angular Component Extractor&lt;/a&gt;: Helper to extract components from templates&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;aesthetics&#34;&gt;Aesthetics&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=zhuangtongfa.Material-theme&#34;&gt;Atom dark theme&lt;/a&gt;: since I used Atom quite a bit before VS code I still feel very at home with this theme, especially in javascript.
_ &lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=Catppuccin.catppuccin-vsc&#34;&gt;Catppuccin theme&lt;/a&gt;: a very popular color scheme that I&amp;rsquo;ve been liking lately — particularly the Macchiato variant.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;make-use-of-vs-codes-recommended-extensions-feature&#34;&gt;Make use of VS Code&amp;rsquo;s recommended extensions feature&lt;/h3&gt;
&lt;p&gt;VS Code has a nifty feature where you can add an &lt;code&gt;extensions.json&lt;/code&gt; file to the root of your project so when a teammate opens the directory in vs code for the first they&amp;rsquo;ll be prompted to view the recommended extensions for the workspace. &lt;a href=&#34;https://code.visualstudio.com/docs/editor/extension-gallery#_workspace-recommended-extensions&#34;&gt;Read more about here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Below is the file you can use for all the extensions I&amp;rsquo;ve mentioned above:&lt;/p&gt;
&lt;p&gt;extensions.json:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// Recommended extensions for VS Code
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// See http://go.microsoft.com/fwlink/?LinkId=827846
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// for the documentation about the extensions.json format
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;s2&#34;&gt;&amp;#34;recommendations&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;// Extension identifier format: ${publisher}.${name}.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;streetsidesoftware.code-spell-checker&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;EditorConfig.EditorConfig&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;dbaeumer.vscode-eslint&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;xabikos.ReactSnippets&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;eamodio.gitlens&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;andys8.jest-snippets&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;Orta.vscode-jest&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;christian-kohler.path-intellisense&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;pflannery.vscode-versionlens&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;esbenp.prettier-vscode&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;some-handy-settings&#34;&gt;Some handy settings&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;quot;editor.fontFamily&amp;quot;: &amp;quot;Fira Code&amp;quot;&lt;/code&gt; - &lt;a href=&#34;https://github.com/tonsky/FiraCode&#34;&gt;Fira Code font&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;quot;editor.codeActionsOnSave&amp;quot;: { &amp;quot;source.fixAll.eslint&amp;quot;: true }&lt;/code&gt; - Any fixable eslint issues will be automatically fixed on save&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;quot;editor.fontLigatures&amp;quot;: true&lt;/code&gt; - Requires a font that supports ligatures like Fira Code&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;quot;workbench.editor.showTabs&amp;quot;: false&lt;/code&gt; - VS Code has excellent tab switching built and IMHO eliminates the need for displaying tabs across the top&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;profiles&#34;&gt;Profiles&lt;/h2&gt;
&lt;p&gt;Now in VS code you can create various &lt;a href=&#34;https://code.visualstudio.com/docs/editor/profiles&#34;&gt;profiles&lt;/a&gt; as a way to group various customizations and extensions. For example, an Angular and a React profile. I highly recommend checking it out.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/vscode-setup/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>You Should be Using Git Hooks</title>
      <link>https://www.brandonpugh.com/blog/you-should-be-using-git-hooks/</link>
      <pubDate>Wed, 01 May 2019 10:54:24 +0200</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/you-should-be-using-git-hooks/</guid>
      <description>&lt;p&gt;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&amp;rsquo;m just going to list some of the ones
I find myself using over and over again.&lt;/p&gt;
&lt;h2 id=&#34;prepare-commit-msg&#34;&gt;prepare-commit-msg&lt;/h2&gt;
&lt;p&gt;This hooks is great for templating your commit messages. &lt;a href=&#34;https://medium.com/nulab/git-commit-messages-for-the-bold-and-the-daring-3cc91a91e29b&#34;&gt;This post&lt;/a&gt; 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.&lt;/p&gt;
&lt;h2 id=&#34;pre-commit&#34;&gt;pre-commit&lt;/h2&gt;
&lt;h3 id=&#34;run-static-code-analysis&#34;&gt;Run static code analysis&lt;/h3&gt;
&lt;p&gt;These hooks are by far used the most often but the trick is to make sure that you don&amp;rsquo;t cause each
commit to take too long to run the checks. Some popular use cases:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;linters&lt;/li&gt;
&lt;li&gt;spell checkers&lt;/li&gt;
&lt;li&gt;code auto formatting&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These checks can save a lot of time on pull requests or code reviews as you&amp;rsquo;re automating a lot of the trivial
issues that can come up and eliminating unnecessary back and forth.&lt;/p&gt;
&lt;p&gt;For example the javascript community uses &lt;a href=&#34;https://prettier.io&#34;&gt;Prettier&lt;/a&gt; to eliminate &lt;em&gt;any&lt;/em&gt; formatting inconsistencies.
The dotnet community has a new tool from the core team &lt;a href=&#34;https://github.com/dotnet/format&#34;&gt;dotnet format&lt;/a&gt; though much
more limited in scope as it only supports formatting configured with an &lt;code&gt;.editorConfig&lt;/code&gt; file
(see &lt;a href=&#34;https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2019&#34;&gt;dotnet coding conventions&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;They can also be helpful for preventing common mistakes you find yourself making as I detailed in a previous post
a while back: &lt;a href=&#34;https://www.brandonpugh.com/blog/2013/08/avoid-committing-dumb-mistakes-with-git-hooks/&#34;&gt;Avoid Committing Dumb Mistakes with Git hooks&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;pre-push&#34;&gt;pre-push&lt;/h2&gt;
&lt;p&gt;This is a much less used hook but I find it helpful to use it to check to make sure you don&amp;rsquo;t accidentally push certain types of temporary commits for example &lt;code&gt;--fixup&lt;/code&gt;
or &lt;code&gt;--squash&lt;/code&gt; commits or sometimes even &lt;code&gt;WIP&lt;/code&gt; commits.&lt;/p&gt;
&lt;h2 id=&#34;ok-im-sold-now-what&#34;&gt;OK I&amp;rsquo;m sold, now what?&lt;/h2&gt;
&lt;p&gt;There are a lot of great resources online already for getting started with hooks and a lot of great tools
for managing them. I recommend starting with &lt;a href=&#34;https://githooks.com/&#34;&gt;Git Hooks&lt;/a&gt; and I will also have a followup post
where I go into detail on the setup and specific hooks I use on my projects.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/you-should-be-using-git-hooks/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Use Netlify for a Poor Man&#39;s Self-Hosted Url Shortener</title>
      <link>https://www.brandonpugh.com/blog/use-netlify-for-a-poor-mans-self-hosted-url-shortener/</link>
      <pubDate>Thu, 02 Mar 2017 10:54:24 +0200</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/use-netlify-for-a-poor-mans-self-hosted-url-shortener/</guid>
      <description>&lt;p&gt;I recently migrated my blog from Github pages to &lt;a href=&#34;https://www.netlify.com&#34;&gt;Netlify&lt;/a&gt; and so far it&amp;rsquo;s been an awesome experience! Netlify gives you so much for free it almost feels like stealing! If you&amp;rsquo;re hosting some static content on github pages or S3 or somewhere, I highly recommend you check them out especially if you have a &lt;a href=&#34;https://www.staticgen.com/&#34;&gt;static gen&lt;/a&gt; build process.&lt;/p&gt;
&lt;p&gt;One of the cool features Netlify gives you is configuring &lt;code&gt;301&lt;/code&gt; redirects using a simple &lt;code&gt;_redirects&lt;/code&gt; file in the root of your site. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;/home              /
/news              /blog
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It also supports external urls so can do things like:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;/linkedin         https://www.linkedin.com/profile
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Pair this with a short domain (Netlify supports custom domains for free!) and you can create your own shortened urls just by adding lines to this file.&lt;/p&gt;
&lt;p&gt;For example, I have a netlify site configured with the domain &lt;code&gt;pugh.pw&lt;/code&gt; and connected to a github repo with this in my redirects file:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;/vim          https://raw.githubusercontent.com/bpugh/dotfiles/master/vim/.vimrc
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now &lt;a href=&#34;http://pugh.pw/vim&#34;&gt;http://pugh.pw/vim&lt;/a&gt; will take me to my &lt;code&gt;.vimrc&lt;/code&gt; file so if I need to &lt;code&gt;ssh&lt;/code&gt; into a new linux machine I can easily fetch my &lt;code&gt;vimrc&lt;/code&gt; with a quick &lt;code&gt;curl&lt;/code&gt; command.&lt;/p&gt;
&lt;h2 id=&#34;when-would-you-use-this&#34;&gt;When would you use this?&lt;/h2&gt;
&lt;p&gt;This is perfect if you want to make some short memorable urls that you control yourself. Services like Bitly are convenient for quick one-off links but you&amp;rsquo;re depending on a third party service and you don&amp;rsquo;t always have complete control over what the url will look like.&lt;/p&gt;
&lt;p&gt;This probably isn&amp;rsquo;t for you if you need features like analytics or creating a large number of links, in which case you might want to look at some more full featured open source options for self hosting a url shortener.&lt;/p&gt;
&lt;p&gt;But with such a simple setup and being able to quickly add links by editing the file through the github UI, this is great for creating some personally branded urls or convenient shortcut links.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/use-netlify-for-a-poor-mans-self-hosted-url-shortener/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Use npm with a proxy that requires authentication</title>
      <link>https://www.brandonpugh.com/blog/npm-proxy-wrapper/</link>
      <pubDate>Fri, 17 Jun 2016 00:12:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/npm-proxy-wrapper/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s pretty easy to configure npm to connect through a proxy by setting the &lt;code&gt;proxy&lt;/code&gt; and &lt;code&gt;https-proxy&lt;/code&gt; config settings and you can even use &lt;code&gt;npm config set&lt;/code&gt; which will store them in your &lt;code&gt;.npmrc&lt;/code&gt; file. Connecting through a corporate proxy that requires authentication, however, can be a little trickier.&lt;/p&gt;
&lt;p&gt;To specify your credentials, you have to place them in the proxy url so your npm command would look something like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install --proxy http://user_name:password@proxy.company.com:8080&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Typing that every time will get old fast. Again you can use &lt;code&gt;npm config set&lt;/code&gt; but the security conscious will probably feel a bit uneasy having your credentials sitting in plain text in a file on disk especially if, like most corporate environments, the proxy uses your active directory credentials.&lt;/p&gt;
&lt;p&gt;To ease the pain I created a powershell wrapper function around npm to prompt for your proxy password:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;np&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nv&#34;&gt;$response&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Read-host&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Enter password&amp;#34;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;-AsSecureString&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nv&#34;&gt;$password&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;no&#34;&gt;Runtime.InteropServices.Marshal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;PtrToStringAuto&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&lt;span class=&#34;no&#34;&gt;Runtime.InteropServices.Marshal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SecureStringToBSTR&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$response&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nv&#34;&gt;$un&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;no&#34;&gt;Environment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Username&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nv&#34;&gt;$proxy&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;http://&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;${un}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;${password}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;@proxy.company.com/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;npm&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$args&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;-proxy&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$proxy&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you add this to your powershell profile then you can then you can call &lt;code&gt;np&lt;/code&gt; in place of &lt;code&gt;npm&lt;/code&gt; and it will prompt you to type your password and then call npm with the parameters you supplied along with the proxy url.&lt;/p&gt;
&lt;p&gt;This does assume the proxy username is the same as your machine username but if not you could tweak the script to prompt you for both.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/npm-proxy-wrapper/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Avoid Committing Dumb Mistakes with Git hooks</title>
      <link>https://www.brandonpugh.com/blog/avoid-committing-dumb-mistakes-with-git-hooks/</link>
      <pubDate>Wed, 14 Aug 2013 00:12:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/avoid-committing-dumb-mistakes-with-git-hooks/</guid>
      <description>&lt;p&gt;&lt;strong&gt;TLDR&lt;/strong&gt;: Git hooks are an awesome way to automatically verify your code as you commit your changes&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m sure we&amp;rsquo;ve all been there where we accidentally committed a change that we were supposed to undo or wasn&amp;rsquo;t ready to be pushed and don&amp;rsquo;t realize it until the build breaks or QA finds a bug.&lt;/p&gt;
&lt;p&gt;The first step I take to avoid committing anything unintentionally is instead of just running &lt;code&gt;git add -A&lt;/code&gt; I make sure to review all the changes in the files I&amp;rsquo;m potentially committing. This is where a graphical tool like Gitk or SmartGit comes in handy as they allow you to click on your modified files and easily view a diff and then select which changes to stage.
Unfortunately changes still slip through as happened to me yesterday when a change of mine got pushed all the way to Test before it was noticed. This led me to create an additional safety net.&lt;/p&gt;
&lt;h3 id=&#34;enter-git-hooks&#34;&gt;Enter Git hooks&lt;/h3&gt;
&lt;p&gt;Client side Git hooks are simply scripts that reside in you local repo in the &lt;code&gt;.git/hooks&lt;/code&gt; directory. These scripts get run at specific times during your local workflow depending on the name of the hook. So for me I wrote a pre-commit hook that checks all the files that are about to be committed and looks for the string &lt;code&gt;&#39;todo: remove&#39;&lt;/code&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Redirect output to stderr.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;exec&lt;/span&gt; 1&amp;gt;&lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;FORBIDDEN&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;todo: remove&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git diff --cached --name-only &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    xargs grep --with-filename -i -n &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$FORBIDDEN&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;COMMIT REJECTED Found &amp;#39;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$FORBIDDEN&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#39; references. Please remove them before commiting&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;exit&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;exit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So now if I make any change that I want to undo before committing, say like commenting out a conditional to make testing easier, I just add a comment like &lt;code&gt;//todo: remove&lt;/code&gt; and git won&amp;rsquo;t let me commit the changes.&lt;/p&gt;
&lt;p&gt;You could also have it look for common debug statements like &lt;code&gt;console.log&lt;/code&gt; in javascript files or even have it run a code analysis tool against the files staged for commit.&lt;/p&gt;
&lt;p&gt;You can download the above hook from this gist: &lt;a href=&#34;https://gist.github.com/bpugh/6a9617ac277c93bc86fe5f1507f5ec90&#34;&gt;https://gist.github.com/bpugh/6a9617ac277c93bc86fe5f1507f5ec90&lt;/a&gt;&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/avoid-committing-dumb-mistakes-with-git-hooks/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Bittorrent Sync - File syncing for developers</title>
      <link>https://www.brandonpugh.com/blog/bittorrent-sync-file-syncing-for-developers/</link>
      <pubDate>Sun, 16 Jun 2013 18:48:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/bittorrent-sync-file-syncing-for-developers/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://labs.bittorrent.com/experiments/sync.html&#34;&gt;Bittorrent sync&lt;/a&gt; is a new file sharing app released by Bittorrent Labs. People are saying its an alternative to popular file syncing services such as Dropbox, SkyDrive, etc. However I don&amp;rsquo;t currently see it as being a true replacement for these services but after playing with for the last few weeks I must say I&amp;rsquo;m impressed and I feel it does sport some cool features I&amp;rsquo;ve long wished for in a file syncing app. I&amp;rsquo;ve even incorporated it into my development workflow as I&amp;rsquo;ll outline later in this post.&lt;/p&gt;
&lt;p&gt;What sets BS apart from similar services is that its purely a peer to peer (P2P) file syncing service. This means that files get transfer directly between your machines without going through a 3rd party&amp;rsquo;s servers. This is handy is you&amp;rsquo;re the more paranoid type dealing with sensitive files and have been turned off by Dropbox&amp;rsquo;s less than stellar track record with security. Also handy for syncing your current projects when your company has a strict policy about letting source code sit on 3rd party servers.&lt;/p&gt;
&lt;p&gt;This has the added benefit of being faster to transfer large files since they don&amp;rsquo;t have to first be uploaded to a third party server and &lt;em&gt;then&lt;/em&gt; downloaded. This recently saved me time when I had to transfer a 100 gb database backup from a remote server. And since it&amp;rsquo;s using the bittorrent protocol it handles disconnects and partial downloads really well so you don&amp;rsquo;t have to worry about having to start a two hour download over again if your connection gets disrupted.&lt;/p&gt;
&lt;p&gt;Also if you have really large files like virtual machine images, these will be pretty costsly to keep synced on something like dropbox but with Bittorrent sync you&amp;rsquo;re only limited by the size of your hard drives.&lt;/p&gt;
&lt;p&gt;One of its selling points for me was its ability exclude files and folders from being synced, a feature which has been frustratingly absent from most popular services. As a bonus this feature is implemented by a .SyncIgnore file! Since the majority of mainstream source control systems implement a similar mechanism for file exclusion most developers can simply copy and paste their existing rules if you want to sync your project files which is exactly what I did.&lt;/p&gt;
&lt;p&gt;Now you may be wondering why you would need to sync your source files if you&amp;rsquo;re already using version control however I&amp;rsquo;ve always been a bit paranoid when it comes to my work in progress. Even though I subscribe to the idea of commit early and commit often, I&amp;rsquo;ve frequently found myself working for the better part of the day before commiting and I just enjoy the peace of mind that the extra bit of redundancy provides. Its also handy for easily switching between working on different machines.&lt;/p&gt;
&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;While you could use Bittorrent sync to replace a service like Dropbox, I think it has some really nice features that can complement traditional sync services especially for some use cases you&amp;rsquo;re likely to have as a developer.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://labs.bittorrent.com/experiments/sync.html&#34;&gt;Bittorrent sync&lt;/a&gt;&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/bittorrent-sync-file-syncing-for-developers/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>The Obligatory Octopress Post</title>
      <link>https://www.brandonpugh.com/blog/the-obligatory-octopress-post/</link>
      <pubDate>Thu, 24 Jan 2013 09:45:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/the-obligatory-octopress-post/</guid>
      <description>&lt;p&gt;I finally migrated my blog from Wordpress to &lt;a href=&#34;http://octopress.org/&#34;&gt;Octopress&lt;/a&gt; and given all the blog posts I came across while getting it setup it seems almost like a rite of passage to blog about it once you&amp;rsquo;ve migrated.&lt;/p&gt;
&lt;h2 id=&#34;why-make-the-move&#34;&gt;Why make the move?!&lt;/h2&gt;
&lt;p&gt;For the hacker street cred of course. But seriously, I was growing really tired with the performance of Wordpress and dealing with shared hosting on Godaddy and my colleague suggested I give Octopress a try and so here I am.&lt;/p&gt;
&lt;p&gt;I did run into some snags getting it building on Windows but now it&amp;rsquo;s running smoothly. I must say I really like the idea of having all of my content version controlled and in a portable plain text format. Plus this will be a good way to get some additional experience with ruby.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/the-obligatory-octopress-post/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Goals for 2013</title>
      <link>https://www.brandonpugh.com/blog/goals-for-2013/</link>
      <pubDate>Fri, 04 Jan 2013 09:33:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/goals-for-2013/</guid>
      <description>&lt;h4 id=&#34;learn-git&#34;&gt;Learn Git&lt;/h4&gt;
&lt;p&gt;&lt;a href=&#34;http://git.com&#34;&gt;Git&lt;/a&gt; seems to be emerging as one of the most popular version
control systems especially for open source projects so it would make sense to
become more proficient especially given my next goal.&lt;/p&gt;
&lt;h4 id=&#34;contribute-to-oss&#34;&gt;Contribute to OSS&lt;/h4&gt;
&lt;p&gt;I really want to give back and contribute to an open source project. With so
many on Github hopefully learning Git will make this less intimidating.&lt;/p&gt;
&lt;h4 id=&#34;learn-a-javascript-framework&#34;&gt;Learn a Javascript framework&lt;/h4&gt;
&lt;p&gt;With javascript becoming more and more popular for creating a rich client side
experience, learning and using a javascript framework is practically
a necessity. I&amp;rsquo;ll probably start looking at either &lt;a href=&#34;knockoutjs.com&#34;&gt;Knockout.js&lt;/a&gt;
or &lt;a href=&#34;backbonejs.com&#34;&gt;Backbone.js&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;attend-an-out-of-town-conference&#34;&gt;Attend an out of town conference&lt;/h4&gt;
&lt;p&gt;Hopefully one of the big ones like &lt;a href=&#34;codemash.org&#34;&gt;Codemash&lt;/a&gt; or &lt;a href=&#34;thatconference.org&#34;&gt;That
Conference&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;become-more-active-on-twitter&#34;&gt;Become more active on Twitter&lt;/h4&gt;
&lt;p&gt;Just seems like a great way to get involved in the development community.&lt;/p&gt;
&lt;h4 id=&#34;migrate-blog-to-octopress&#34;&gt;Migrate blog to Octopress&lt;/h4&gt;
&lt;p&gt;I&amp;rsquo;ve been having annoying performance issues with my current Wordpress setup on
on Godaddy and Octopress seems like a fun project to play with. Not to mention
the hacker street cred&amp;hellip;&lt;/p&gt;
&lt;h4 id=&#34;automate-my-dev-environment-setup&#34;&gt;Automate my dev environment setup&lt;/h4&gt;
&lt;p&gt;After having to setup a new machine recently I&amp;rsquo;ve decided my next would probably
use some combination of &lt;a href=&#34;chocolatey.org&#34;&gt;Chocolatey&lt;/a&gt; and powershell to automate
as much of the process as possible.&lt;/p&gt;
&lt;h4 id=&#34;learn-a-new-programming-language&#34;&gt;Learn a new programming language&lt;/h4&gt;
&lt;p&gt;This is probably constantly on every developer&amp;rsquo;s list but I&amp;rsquo;ve really been
wanting learn Ruby or Python. A functional language would also be really fun to
learn like F#&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/goals-for-2013/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Checking if a dom element exists with JQuery [Byte sized tips]</title>
      <link>https://www.brandonpugh.com/blog/checking-if-a-dom-element-exists-with-jquery/</link>
      <pubDate>Mon, 25 Jun 2012 21:52:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/checking-if-a-dom-element-exists-with-jquery/</guid>
      <description>&lt;p&gt;This is a simple tip but one I feel makes my code a bit easier to read.&lt;/p&gt;
&lt;p&gt;I was never very pleased with the standard way of checking if a dom element exits in jquery:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;#userName&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;length&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!==&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//do something with $(&amp;#39;#firstName&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The solution I like is to create a very simple jQuery plugin to encapsulate this logic:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// this extension reads better when selecting elements
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;fn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;exists&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;length&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!==&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can place this anywhere you like such as in a &amp;lsquo;utils.js&amp;rsquo; file, so long as it loads after jQuery. Now your code
would like so:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;#userName&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;exists&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()){&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//do something with $(&amp;#39;#firstName&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/checking-if-a-dom-element-exists-with-jquery/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>How to use jQuery .on() instead of .live()</title>
      <link>https://www.brandonpugh.com/blog/how-to-use-jquery-on-instead-of-live/</link>
      <pubDate>Sun, 15 Jan 2012 21:52:25 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/how-to-use-jquery-on-instead-of-live/</guid>
      <description>&lt;p&gt;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:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;.submitButton&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;click&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;validateForm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It doesn&amp;rsquo;t get much easier than that. However, a lot of times we&amp;rsquo;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 .live() method comes in really handy:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;.submitButton&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;live&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;click&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;validateForm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;However if you&amp;rsquo;re using jQuery 1.7 and up you now have access to the .on() method which is a very versatile method offering a number of improvements over .live(). &lt;a href=&#34;https://www.bitovi.com/blog/why-you-should-never-use-jquery-live&#34;&gt;This post&lt;/a&gt; does a good job of explaining the main issues with using live, all of which you can avoid by using .on().&lt;/p&gt;
&lt;p&gt;So how do you go about using .on()? Well .on() basically provides a consistent interface for practically all your event binding needs. You can replace the first example with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;.submitButton&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;on&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;click&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;validateForm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;and you can obviously replace &lt;code&gt;&#39;click&#39;&lt;/code&gt; with whatever event you wish to handle.&lt;/p&gt;
&lt;p&gt;Now to replace the previous live() example with .on() requires the tiniest bit more effort. The way .on() works is it will attach the event to the first selector you specify and if you specify a second selector it will look at all the events that bubble up to it and will only execute the event handler for events that came child elements matching the second selector. So we could replace the example with this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;#userForm&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;on&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;click&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;.submitButton&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;validateForm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since the submitButton element is a child of the userForm element, the click event from the button will bubble up the dom and when it reaches the form element our event handler will be called. This is how we can dynamically insert as many elements with the calls submitbutton and have them be automatically handled. This is essentially the same thing that .live() accomplishes however it does so by automatically attaching the event handler to the document element which can have performance implications as now our click event would have to bubble all the way up the dom tree to the document before the handler will see it. It would look like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;document&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;on&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;click&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;#submitButton&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;validateForm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s look at one last examle:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;#dataTable tr&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;live&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;click&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;event&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;alert&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;());&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is a fairly common scenario where &lt;code&gt;#dataTable&lt;/code&gt; is populated dynamically by data retrieved asynchronously from the server. Again the issue here is that all the events have to bubble up to the document before they are seen by the handler. We can instead replace this with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;#dataTable tbody&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;on&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;click&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;tr&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;event&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;alert&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;());&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/how-to-use-jquery-on-instead-of-live/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>My thoughts on the Global Day of Coderetreat</title>
      <link>https://www.brandonpugh.com/blog/my-thoughts-on-the-global-day-of-coderetreat/</link>
      <pubDate>Fri, 09 Dec 2011 23:04:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/my-thoughts-on-the-global-day-of-coderetreat/</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re unfamiliar with the format of a Coderetreat you can read all about it at &lt;a href=&#34;http://coderetreat.com&#34;&gt;coderetreat.com&lt;/a&gt; but its basically a code kata where you spend most of the day pairing up in 45 min sessions and attempt to solve Conway&amp;rsquo;s Game of Life (a fascinating problem by itself). I had only first heard about it a couple weeks before when Corey Haines went on the Herding code podcast to talk about it and I&amp;rsquo;m glad I went because I feel took away a few key benefits.&lt;/p&gt;
&lt;h2 id=&#34;getting-to-know-my-community&#34;&gt;Getting to know my community&lt;/h2&gt;
&lt;p&gt;I hadn&amp;rsquo;t realized what a strong development community there was in my city and I met some really cool people who were not only fun to talk to but who I could learn lots of new things from. I found out that there are other regular meet ups such as the &lt;a href=&#34;http://twitter.com/#!/dallashackclub&#34;&gt;Dallas Hack Club&lt;/a&gt; which I plan to start attending. I even found out that there are quite a few other people besides me who still like to use Vim or Vi key mappings!&lt;/p&gt;
&lt;h2 id=&#34;the-value-of-tdd&#34;&gt;The value of TDD&lt;/h2&gt;
&lt;p&gt;In school and the places I&amp;rsquo;ve worked there hasn&amp;rsquo;t been a very strong emphasis on the importance of TDD or even unit testing so I had only ever dabbled in it after reading about in various books and blog posts. After the Coderetreat however, I was sold. The Coderetreat very strongly encourages following TDD practices and pairing up with an experienced unit tester or TDD practitioner is a great way to learn. Its true that you can get addicted to the quick feedback you get from unit tests and the safety in knowing that whenever we went back and refactored one of our methods we didn&amp;rsquo;t have to worry that we broke something since the unit tests still passed. One of my partners suggested that I read Michael Feathers book &lt;a href=&#34;http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052&#34;&gt;Working Effectively with Legacy Code&lt;/a&gt; and it is looking to be a great read. The bulk of what I&amp;rsquo;m currently doing at work is maintaining existing systems and now I&amp;rsquo;m working on incorporating unit tests into my updates.&lt;/p&gt;
&lt;h2 id=&#34;exposure-to-new-languages&#34;&gt;Exposure to new languages&lt;/h2&gt;
&lt;p&gt;Coderetreat is language agnostic so they encourage pairing up with someone with development experience fairly different from your own which is a great way to see other programming languages in action. I probably spent most of the morning with Ruby guys and it was impressive to see how quickly we could go from a blank project to our first failing test! I also saw some of the cool things you can do with Rake as far as automatically building .net projects and I got some exposure to &lt;a href=&#34;http://nspec.org/&#34;&gt;NSpec&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So I highly recommend attending a Coderetreat if you get the chance but at the very least get out in your community by attending some local user groups or conferences.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/my-thoughts-on-the-global-day-of-coderetreat/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Getting started with PetaPoco and Postgres</title>
      <link>https://www.brandonpugh.com/blog/getting-started-with-petapoco-and-postgres/</link>
      <pubDate>Wed, 30 Nov 2011 17:50:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/getting-started-with-petapoco-and-postgres/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m currently working on a project I&amp;rsquo;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 &lt;a href=&#34;https://github.com/robconery/massive&#34;&gt;Massive&lt;/a&gt; but while I&amp;rsquo;ve heard some really great things about Massive, I felt it might be a tough sell to my team members who aren&amp;rsquo;t too comfortable with Expandos and its dynamic nature (I know, but change in baby steps I suppose). Then I came across &lt;a href=&#34;http://www.toptensoftware.com/petapoco/&#34;&gt;PetaPoco&lt;/a&gt; and it seemed to fit the bill. Its basically a mico-ORM like Massive with built in support for Postgres except that it also works with POCOs (Plain old CLR Objects) and was pretty easy to get up and running with.&lt;/p&gt;
&lt;p&gt;First if you&amp;rsquo;re not already working with Postgres you&amp;rsquo;ll need to install a &lt;a href=&#34;https://www.npgsql.org/&#34;&gt;provider like Npgsql&lt;/a&gt;. You can get the assemblies from their site or use Nuget with the command &amp;ldquo;Install-Package Npgsql&amp;rdquo;. If you were already using Postgres like I was you&amp;rsquo;ll have to add a bit more to the web.config/app.config in order to use PetaPoco.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-xml&#34; data-lang=&#34;xml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;system.data&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;nt&#34;&gt;&amp;lt;DbProviderFactories&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	  &lt;span class=&#34;nt&#34;&gt;&amp;lt;add&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;name=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Npgsql Data Provider&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;invariant=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Npgsql&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;support=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;FF&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;description=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;.Net Framework Data Provider for Postgresql Server&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		   &lt;span class=&#34;na&#34;&gt;type=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Npgsql.NpgsqlFactory, Npgsql, Version=2.0.11.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7&amp;#34;&lt;/span&gt; &lt;span class=&#34;nt&#34;&gt;/&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;nt&#34;&gt;&amp;lt;/DbProviderFactories&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;/system.data&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;connectionStrings&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;nt&#34;&gt;&amp;lt;add&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;name=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Postgres&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;connectionString=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Server=localhost;Port=5432;User Id=testuser;Password=secret;Database=testdb;&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;providerName=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Npgsql&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;/&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;/connectionStrings&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Notice you have to add the DbProviderFactories to the system.data section (you can also do this in the machine.config though you may run into issues when you deploy) and be sure to specify that as the providerName in the connection string.&lt;/p&gt;
&lt;p&gt;Next install PetaPoco which you can get from Nuget with &amp;ldquo;Install-Package PetaPoco&amp;rdquo; which installs it in your project with some handy T4 templates for generating pocos from your database schema but all you really need is the single PetaPoco.cs file somewhere in your project and you should be ready to go. &lt;a href=&#34;http://www.toptensoftware.com/petapoco/&#34;&gt;Check out their site&lt;/a&gt; for some great examples to get coding.&lt;/p&gt;
&lt;p&gt;Its also worth noting though that if you&amp;rsquo;re targeting .Net 3.5 you&amp;rsquo;ll need to define **PETAPOCO_NO_DYNAMIC **as a conditional compile symbol in your project settings or it won&amp;rsquo;t compile since PetaPoco now also supports dynamics.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/getting-started-with-petapoco-and-postgres/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>GhostDoc [Dev tool of the week]</title>
      <link>https://www.brandonpugh.com/blog/ghostdoc-dev-tool-of-the-week/</link>
      <pubDate>Wed, 19 Oct 2011 11:43:00 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/ghostdoc-dev-tool-of-the-week/</guid>
      <description>&lt;p&gt;Thought I would try to make it a thing where I post about a particular tool I&amp;rsquo;m using that makes life easier for me as a developer.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://submain.com/products/ghostdoc.aspx&#34;&gt;GhostDoc&lt;/a&gt; is a cool little Visual Studio plugin that makes commenting your methods and properties much easier. With a keyboard shortcut or right clicking on a method name, GhostDoc will automatically generate xml documentation comments by intelligently looking at the method name and parameters:&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://www.brandonpugh.com/images/GhostDoc_Sample_CSharp_660x340.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;I know how we can all get lazy when it comes to documenting our code especially when we&amp;rsquo;re on a time crunch but I&amp;rsquo;ve definitely found GhostDoc helps minimize a bit of the friction when it comes to writing documentation comments and your team members will definitely thank you for it.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://submain.com/products/ghostdoc.aspx&#34;&gt;GhostDoc&lt;/a&gt;&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/ghostdoc-dev-tool-of-the-week/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Allow pasting multiple lines in IE textbox</title>
      <link>https://www.brandonpugh.com/blog/allow-pasting-multiple-lines-in-ie-textbox/</link>
      <pubDate>Wed, 12 Oct 2011 23:21:07 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/allow-pasting-multiple-lines-in-ie-textbox/</guid>
      <description>&lt;p&gt;You may have noticed before that if you try to paste more than one line of text into a textbox in Internet explorer it will on only paste in the first line and disregard the rest. Firefox and Chrome on the other hand will automatically paste all lines of the text onto the one line of the textbox. This issue came up in one of the projects I&amp;rsquo;m currently working on where we wanted users to be able to paste in a list of ID numbers they wanted to run a search on.&lt;/p&gt;
&lt;p&gt;I knew it was possible to get it working in IE since I had seen it done with the search box on Google Maps. I figured the way to do it would be to be to capture the text from the clipboard when the user is attempting to paste it into the textbox and reformat the text into a single line. In the end this is what the javascript looked liked:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;clipboardData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;#textboxId&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;bind&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;paste&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;clipped&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;clipboardData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Text&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nx&#34;&gt;clipped&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;clipped&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/(\r\n|\n|\r)/gm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34; &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;//replace newlines with spaces
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;val&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;clipped&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;//cancel the pasting event
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To begin with, I&amp;rsquo;m using &lt;a href=&#34;http://jquery.com&#34;&gt;jQuery&lt;/a&gt; because it&amp;rsquo;s incredibly powerful and it&amp;rsquo;s 2011 and if you&amp;rsquo;re not using a javascript library then you are missing out. This allows me to bind an event handler for the paste event to the textbox element. Note that the paste event is supported in practically all browsers however for security reasons accessing the clipboard is only supported in IE. Fortunately for this purpose I&amp;rsquo;m only interested in Intenet Explorer and we can get the text with window.clipboardData object. Passing &amp;lsquo;Text&amp;rsquo; into the getData() function is required to return the data as text.&lt;/p&gt;
&lt;p&gt;Next calling .replace() on the text to replace all of the newline characters with spaces (or any delimeter we choose). Then we simply set the value of the textbox to the newly formatted text.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;clipped&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;clipped&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/(\r\n|\n|\r)/gm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34; &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;//replace newlines with spaces
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;val&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;clipped&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Also don&amp;rsquo;t forget to call &lt;em&gt;return false;&lt;/em&gt; to prevent the original text from still being pasted in.&lt;/p&gt;
&lt;p&gt;Lastly we need to handle what will happen in all other browsers. We only want to attempt to read from clipboardData in IE since it will be undefined in all other browsers. One way to accomplish this is by detecting what browser the user has however this is not recommended. The trend nowadays is to use feature detection and there are entire javascript libraries such as &lt;a href=&#34;http://modernizr.com&#34;&gt;Modernizr&lt;/a&gt; dedicated to detecting which features a browser supports and then degrading gracefully when it doesn&amp;rsquo;t. In this case we can simply surround our code with an if statement to ensure our code won&amp;rsquo;t cause any errors outside of Internet Explorer.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;clipboardData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;){}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And there you go, overcoming one of Internet Explorer&amp;rsquo;s shortcomings with some simple and concise javascript.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/allow-pasting-multiple-lines-in-ie-textbox/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>VsVim [Visual Studio extension showcase]</title>
      <link>https://www.brandonpugh.com/blog/vsvim-visual-studio-extension-showcase/</link>
      <pubDate>Sun, 09 Oct 2011 23:59:33 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/vsvim-visual-studio-extension-showcase/</guid>
      <description>&lt;p&gt;I thought I might do an occasional series of posts on useful visual studio extensions that I use and I&amp;rsquo;m starting off with one of my must-haves: &lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=JaredParMSFT.VsVim&#34;&gt;VsVim&lt;/a&gt;. Vim, for those of you who don&amp;rsquo;t, is a powerful command line based text editor that has been around for a long time. I had to learn it when I was a freshman at college and we had to compile our C++ programs on a central Unix server over SSH and I&amp;rsquo;ve been hooked ever since.&lt;/p&gt;
&lt;p&gt;If you want all the power of the Visual Studio IDE but don&amp;rsquo;t want to give up the power of vim&amp;rsquo;s modal editing and key bindings then this is the extension for you. It&amp;rsquo;s open source and very actively maintained and one of the best vim ports I&amp;rsquo;ve ever used. By using a &lt;code&gt;.vsvimrc&lt;/code&gt; file you can get an editing experience that stays very true to vim.&lt;/p&gt;
&lt;p&gt;Give it a try: &lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=JaredParMSFT.VsVim&#34;&gt;VsVim&lt;/a&gt;&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/vsvim-visual-studio-extension-showcase/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>My development journal</title>
      <link>https://www.brandonpugh.com/blog/my-development-journal/</link>
      <pubDate>Thu, 06 Oct 2011 06:30:40 +0000</pubDate>
      
      <guid>https://www.brandonpugh.com/blog/my-development-journal/</guid>
      <description>&lt;p&gt;After having just watched one Rob Conery&amp;rsquo;s excellent screencasts at Tekpub on going from Coder to Developer, I&amp;rsquo;ve finally decided to start my own blog. Rob suggested possibly making it something of a development journal if you&amp;rsquo;re learning a new language or technology and being relatively new to the industry and being a lead developer, it feels like I&amp;rsquo;m learning so much so fast. So this is my outlet for recording/sharing my experiences, knowledge, trials, triumphs, and mistakes with anyone who might find it interesting or useful.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/blog/my-development-journal/feed&quot;&gt;
      </description>
    </item>
    
  </channel>
</rss>