Blog

Git checkout non-origin remote pull request

I don’t often review pull requests that come from non-origin remotes. This is largely because Automattic tends to create pull requests in the root repository. So, when I reviewed a pull request from an open source contributor today, I found myself wandering if there was a simple way to checkout the pull request locally for testing.

I knew that I could add a new remote, fetch from the new remote, and then checkout the pull request. But, my lazy developer brain figured there was an easier way. 😄

So, I asked my fellow Automatticians if they had any tips/tricks and I got a few good ones.

First, and probably the best solution, is to use the Github’s CLI tool. Once you’ve installed that, you can then checkout a pull request locally with something like:

gh pr checkout {<number> | <url> | <branch>}

But, if you’re relatively happy with your git flow and are looking for a little helper for this specific case, then you may be interested in this blog post by Scott Lowe. In that post, Scott shares a tip for fetching the branch from the non-origin remote to your local machine in a single command:

git fetch origin pull/1234/head:pr-1234

In my testing, this worked very well for me. But, I wanted to be a bit lazier. So, I ended up throwing that command in a shell function that expects the pull request number as an argument and then:

  1. Fetches the branch from the non-origin remote
  2. Checks out the branch from the non-origin remote

That function looks like this:

function gcopr() {
	$( git fetch origin pull/"$1"/head:pr-"$1" )
	$( git checkout pr-"$1" )
}

I’ve got this function in my ~/.oh-my-zsh/custom` directory and I use it like this:

gcopr 42940

Building a backyard air pistol range

I bought a MatchGuns MG1 air pistol at the Arizona Desert Midwinter championship earlier this year. But, until recently, I had not taken advantage of this pistol. Primarily because I didn’t feel like I had a good setup in the backyard.

For example, here’s a photo of my backyard from a period where we were having some work done.

The backyard while getting some work done

This photo is looking from the back of my house to the alley. What this picture doesn’t illustrate is:

  • Past that chain link fence is an alley way that people often drive or walk down
  • Past the alley and the bushes is a park
  • Just a few feet past my fence line on the right there is a dog pen with a couple of dogs
  • My neighbor to the right has a couple of kids that play in the yard
  • I also have a neighbor to the left

I didn’t want to shoot the air pistol in my back yard and risk 1) accidentally hurting someone or 2) scaring a passerby that then called the cops, even though shooting air pistol on one’s own property is legal in my city.

With that in mind, I began planning how I could setup the backyard in a way that I’d feel comfortable shooting air pistol.

Privacy fence

When thinking about the above issues, the first thing that came to mind was, “Boy, it sure would be nice if I had a privacy fence.” A privacy fence would act as a backstop to ensure that any misses stayed on my property AND it would block passersby from being able to see me shooting in the backyard. 😱

So… we had one built. 😂 The picture below is from roughly the same place as the picture above, but looking toward the back left corner of my backyard.

A picture of the backyard before the staining was complete

To be clear, we didn’t have the privacy fence put up solely so that I could shoot. It’s something that we’ve talked about in the past. But, wanting to shoot air pistol in the backyard was definitely the motivation that I needed to actually get the fence built. 😄

Setting up the target

While researching some options for setting up the target for my air pistol range, probably the best article that I found and read was the safe backstops and bullet traps article on Pyramd Air. The article makes several suggestions, but what stood out to me were the several mentions of the Champion trap in the comments.

This trap is made from steel and is rated to stop .22 caliber bullets. So, it seemed like a safe option for stopping .177 pellets. 😄

The issue that I ran into once I got the trap was how to set it up…

At first, I thought about just mounting the trap to the fence directly. But, I didn’t like this option because it would have added significant weight to our new fence.

Then, I thought about adding a folding table to the fence, after reading this blog post, so that I could place the trap on the fence when necessary. But, in the end, I decided against this option because it would minimize my options for a backstop (in case I missed the trap).

So, I put things off for a bit. One day, while out running errands, I noticed that several stores were putting fence posts in buckets and filling the buckets with concrete in order to cordon off areas and/or post temporary signs. This was during the coronavirus pandemic after all…

After seeing this at several stores, it clicked that I could do the same thing in my backyard so that I ended up with a functional, movable trap holder.

So, without further ado, here are a couple of pictures with the trap stand that I created, with and without the trap mounted.

While the trap is portable, I did pick the above location for a reason. 😄 Specifically, since my carport is behind the target, that means that a missed shot would need to make it through two layers of privacy fence, and possibly my car, to end up in my neighbor’s yard.

Here’s a selfie with the trap in the background.

Disregard the dog in the background. I shoo him off before shooting 🙂

Future work

I’m liking my backyard and air pistol range. But, nothing is perfect. 😄

One thing that you may notice in the pictures above is that there is very little protection against errant shots that go high. Personally, I don’t expect to shoot a shot wide enough that it misses the trap. But, shit happens. ¯_(ツ)_/¯

One thing that I’d like to do in the near future is add a backstop that 1) protects the fence and 2) adds some protection above the fence line. Until I have that backstop in place, I don’t plan on letting anyone else shoot my air pistol in the backyard. 😉

Removing sagging phone lines from house

Several months ago, after we removed an old gazebo from our yard, I began noticing a sagging line. I was able to ignore it for a while. But, after completing some recent work in the yard, I just couldn’t ignore it any more. 😄

The breaking point was me being able to touch the wire with my head. Not knowing what kind of line this was, I went out to the pole to see what I could find out. This worked out well for me since I was able to trace the line back to this enclosure.

You may not be able to read that sticker, but the important part is that it says Southwestern Bell Telephone, so I immediately knew this was a telephone wire. Since we don’t even use a landline in the house, I began my search to figure out how I could get this line removed.

It didn’t take long to figure out that Southwestern Bell and ATT merged at some point and that I’d need to contact ATT to get the telephone line handled. But, what I wasn’t prepared for was how much of a pain in the ass this would be. I ended up calling ATT multiple times and getting passed through various departments, each time being told that they couldn’t help me because I wasn’t an ATT customer.

After a few failed attempts, over a couple of hours, I finally gave up and messaged ATT on Facebook. I kid you not, within TEN minutes, a customer service representative replied from ATT, giving me a link to instructions for getting the line fixed.

I’ll share the link here in case anyone finds their way to this post in a similar situation. 😄

After following the instructions on the link, a technician was able to come out the same day and remove the unused telephone lines from my house!

Recording completed tasks with Alfred

At Automattic, many teams have a process where they post weekly, or biweekly, updates. One of the things that I’ve often found difficult, as I write my personal update, is remembering all of the little things that I did for the past week.

Sure, since I work on the computer, there’s usually some paper trail for what I did. But, getting that paper trail meant that I needed to comb through various sources and then also try to remember the things that didn’t have a paper trail.

One of my favorite tools for getting all of the tasks that I completed in one place, and minimizing the number of things that weren’t tracked, was iDoneThis. But, it’s got a lot more functionality than I need. So, I set out to implement something to track completed tasks locally.

A simple Alfred workflow

Introducing the Dones workflow for Alfred! 🎉

This very simple workflow works by querying done {query}. The workflow will then take over and do the following:

  • Create a new file with a name like 2020-03-31.txt, where 2020-03-31 is the current date
  • Add the done as a new line in that file, prepended with a timestamp. Ex. 4:19:32 PM: hello world

With this setup, you’ll get a single file for each day that you record dones. You can then browse through those in the standard Mac file browser.

Installation

To install the Dones workflow, simply download the workflow from Github and then double click to import it in Alfred.

Future work

At the moment, there is no definite future work planned. That being said, one nice-to-have that is on my mind is adding a command to sum up a period’s dones. For example, maybe something like dones_sum 7 that gets the past 7 day’s worth of dones.

Arizona Desert Midwinter Championship 2020

This past week, I traveled to Phoenix, Arizona to compete in the Arizona Desert Midwinter Championship.

Here’s a bit of a teaser video and then you can continue reading the rest of the post if you’d like. 😄

Initially, my only interest in this match was for the service pistol and rimfire EIC matches that were being held. So, my plan was to arrive Friday night, shoot on Saturday afternoon, and then book it back home on Friday. Wichita Falls is a bit more than 14 hours away from Phoenix, so that would’ve been a lot of miles in just a few days. This was fine with me though because I’ve had that points monkey on my back ever since I got my hard legs for both service pistol and rimfire pistol.

A month or so before the trip, another Texas shooter, Mason Talbert, posted in a Facebook group asking if other Texas were traveling to the matches and whether they wanted to plan travel together. The catch, Mason wanted to go all of the matches in the week. This meant that I would need to extend my travel from 3 days to at least 7 days. More importantly, that meant that I would need to miss an entire week of work instead of just one day. 😱

That’s a lot of time, especially considering that I’d like to go to the national matches this summer as well, which will be 1-2 weeks. But, getting to hang out with, and learn from, Mason and others made it worth the trip. So, I ran it by the bosses (wife and work) and got permission to go. 🎉

Travel

As mentioned above, the trip from Wichita Falls to Phoenix is about 14 hours by car. My route would normally be go north through Amarillo, through Albuquerque, and then on to Phoenix. But, since Mason lives in College Station, I ended up taking the southern route, which went through El Paso and Las Cruces, so that Mason and I could meet up in Midland.

Wichita Falls, TX to Phoenix, AZ

The trip itself was pretty simple on the way there. We met in Midland, loaded Mason’s stuff in my car, hit the road again, and then stopped in El Paso for the night. The next morning, we took off around 7am and got to Phoenix by 3pm.

The way back, however, was a bit of a drag. 😂 We didn’t leave until after the awards were given out on Sunday afternoon, which was about 2:30pm. Since we were leaving late, we knew that it wasn’t a great idea for either of us try to make it all the way back home. So, we decided that we’d stop in Midland for the night. This was about a 10.5 hour drive, which meant that the earliest that we’d arrive was about 1am. With various stops, we didn’t actually arrive to Midland until 3am.

Results

Overall, I was pretty happy with my results. The week started out rough, but got better as it went along. I did less than my average for air pistol, standard pistol, service pistol 900, and EIC matches. But, after getting some advice from Mason, I was able to start the 2,700 match with a new focus and shoot a personal best.

That personal best was shooting a 2,398/2,700. This also means that I’m shooting nearly 89% and getting close to being reclassified as an expert. 🎉 I believe that score was also good for second overall sharpshooter.

Photos

Takeaways

Competing in large matches takes a lot in general, whether it’s time, money, effort, etc. The payoff in going to large matches though are:

  1. Getting access to matches, such as centerfire pistol, air pistol, standard pistol, and EICs
  2. Getting to interact with and learn from great shooters

The second of those, interacting with and learning from great shooters, is really the biggest payoff for me. Below are some of the takeaways that I got from this match:

  • “Ask the trigger” to go instead of “tell the trigger” to go.
    • This nugget comes from Mason. I understand this as a different way to describe triggering, instead of using “squeeze the trigger” or “slowly pull the trigger”.
  • Treat the trigger like your best friend, which means spending time with it and understanding its preferences.
    • This nugget also came from Mason. I understand this as dry fire more and don’t be afraid to try a slightly different approach to triggering if something stops working. Mason described that second bit as taking your friend to the arcade if your friend decided that they didn’t like going to the movies anymore.
  • Be bored shooting 10s. Shooting 10s are great, but you shouldn’t jump for joy every time you shoot a 10. You should expect to shoot a 10.
  • “Just do that thing you know how to do.”
    • When talking to Mason about the recent funk I’ve been in, he mentioned that sometimes he tells himself to “do that thing he knows how to do”. When he gets to the line, he’ll think that to himself before and in between shots.
  • “Push your legs down and out” for more stability.
    • This was a suggestion from John Zurek to Mason.

Pistol Training 1-26-2020

Since 4-H rifle and pistol classes were today, and I was already going to conveniently be at the range to coach a few kids. I got to the range about 1.5 hours early to set the range up and get some practice in.

To get the most out of the limited time I had before students and coaches started showing up, with my 45 calibre pistol, I did a few minutes of dry fire followed by about 80 shots of progressive training. For more about progressive training, see my last training post.

I had a bit of a rough time with the first 40 shots. But, I ended up with a solid target for my next 40 shots:

Some takeaways/thoughts that I had:

  • Many of my misses were low, which could be relaxing or jerking the trigger (which definitely happened several times)
  • After getting home and cleaning the pistol, including the trigger parts, the trigger was MUCH SMOOTHER. I should probably clean the trigger parts much more often, or find a way to keep them lubricated better
  • I often lost the front sight in the aiming black (with center hold). I’ve noticed that my white dot no longer shows on the front sight. I need to paint this back on.

Pistol Training 1-20-2020

With 3 pistol matches coming up in February, and having spent a majority of my time training in December on slow fire, I needed to get out to the range to focus on sustained fire.

So, tonight, after work and dinner were done, I headed out to the range to focus on sustained fire.

Rough Training Plan

  • Dry fire
  • Group fire
  • Blank face timed and rapid fire
  • Rapid fire practice

In reality, I ended up adding the following:

  • Progressive training
  • Rapid fire practice

Blank Face

After talking to Daniel Miller at the January bullseye match at Dallas Pistol Club, I decided that I would add some blank face firing to my sustained fire training. The idea with a blank face is that you don’t have a definite aiming point. Because of that, you’re able to focus much more on trigger pull and cadence since there is less pressure.

Here is a picture of 40 shots fire on a blank face target.

Just looking at that group, with no scoring rings on the repair center, what do you think the rough score percentage would be? Well, let’s look at the front of the repair center with the scoring rings.

By my count, the shots are as follows:

  • 10 14
  • 9: 14
  • 8: 9
  • 7: 2
  • 6: 1

Added up, the total score was 358. Out of 400, that’s 89.5%! 😱 Not too bad for just pointing the pistol down range and pulling the trigger, eh?

Needless to say, after shooting 40 shots on a blank face, I was feeling pretty confident. So, I moved on to rapid fire.

Rapid Fire Training

When I started rapid fire training, I noticed that I was shooting very quickly and that my shots were grouping quite low and to the left. After several strings of this, and after grouping quite well in the center of the target for group fire, I was certain that I was jerking the trigger.

So, I paused on rapid fire and moved to progressive training.

Progressive Training

Progressive training is a fun game/drill that I read about in a reply from Ed Hall on Bullseye-L forum. I did quite well with the progressive training, keeping all of the shots in the black (my chosen ring), until…

My first string of 5 shots. On that string, I jerked the trigger on nearly every shot and ended up putting 4 low left, out of the black. I recovered in my next string of 5 though by putting all of the 5 shots in the black.

Overall, I was happy with how the progressive training went. It effectively acted like a reset from when I was consistently throwing shots low left in rapid fire. Feeling happy with the results, I moved on to a few strings of rapid fire and did much better.

Takeaways

In the future, perhaps I should schedule sustained fire training like this:

  • Dry fire
  • Group fire
  • Blank face
  • Progressive training
  • Rapid fire practice

The thinking behind this is that I’ll warm up with dry fire and then from there add little by little until I’m shooting full rapid fire strings. My hope is that this will minimize jerking the trigger.

Another thing I noticed was occasionally breaking my wrist. I even specifically pointed that out on one of my targets above. It’s not a big concern at the moment, but something to keep an eye on.

Simple age shortcode for WordPress

As I was updating the about page on this blog today, I decided that I wanted to make my age in the following string dynamic: “I am a 31-year-old Texan”. After considering options, creating a shortcode seemed like a simple enough route. Here’s the code that I came up with:

/**
 * A simple shortcode for displaying a person's age within WordPress content. This was
 * created with an "about" in mind, so that I wouldn't have to keep updating my age. :)
 * 
 * Usage: [simple_age birthday="January 1 2020"]
 */
function simple_age_shortcode( $atts ) {
	if ( empty( $atts['birthday'] ) ) {
		return '';
	}
	
	// If the birthday couldn't be parsed, then show some numeric output at least ¯\_(ツ)_/¯
	$birthday = strtotime( $atts['birthday'] );
	if ( ! $birthday ) {
		return 0;
	}
	
	$time_diff  = time() - $birthday;
	$years_diff = floor( $time_diff / YEAR_IN_SECONDS );
	
	return intval( $years_diff );
}
add_shortcode( 'simple_age', 'simple_age_shortcode');

Then, in my about page, I modified the content to look like this:

I am a [simple_age birthday="January 1 2020"]-year-old Texan...

To add this code to your site, you can add it as a plugin, in the functions.php file of your theme, or you could use a plugin like Code Snippets (which is my favorite option for small bits of code like this).

If you land here, then hopefully you find this simple age shortcode for WordPress handy. 😄 If there’s some interest, I may consider adding the plugin to the core repo to make it easier for people to use the shortcode. Feel free to leave a comment below if you’d prefer that.

NWTFS September Rifle Match

Last month, Destiny and I attended the high power rifle match at Northwest Texas Field and Stream Association. This was the first match that Destiny and I had competed in at the club, and it was only the second time that we had ever competed. The first time that we competed being at the Rifle SAFS competition at Camp Perry in 2019.

Below are some pictures and video from the match.

Camp Perry Pistol Week– 2019

I spent last week, July 8th-14th, at Camp Perry in Port Clinton, Ohio for the National Precision Pistol Championship.

The Trip

The trip was about a 17 hour drive to get from Wichita Falls, Tx to Port Clinton, Ohio.

And with 4 people and all of our gear, you can imagine that the van we took was pretty packed! The picture below is with the two back seats folded down. 😱

We left on Saturday the 6th, directly following the Don James Memorial match at Northwest Texas Field and Streams, stayed in St. Louis for the night, and then finished the trip on the 7th. On the way back, we left Port Clinton at about 7:15am and drove through until we got to Wichita Falls.

The Hut

While at Camp Perry for pistol week, the group of folks from Wichita Falls stayed in a hut. Huts cost $52 per night, have four beds, power outlets, and an air conditioner. Here’s a panorama picture of what our hut looked like from the front door.

And here’s a picture of what our hut looked like from the outside. Notice all of the mayflies on the building. 😱

Results

The match results for pistol week at Camp Perry can be found at the following links:

To summarize, I took third marksman for the NRA championship but did not receive any points or win for the CMP matches. All the same, it was a great week.

Photos

Install Unison 2.48.4 on Mac OS X with Homebrew

I use Unison to sync code between my local machine and my dev servers. To sync between two servers, it requires that the same version of Unison be installed on both servers.

Now, this isn’t usually a big deal, because once you get Unison set up, it’s set up. But, I usually get a bit frustrated when setting up a new development machine and ensuring that it has the same Unison version as my remote server.

Most recently, I needed to get Unison 2.48.4 on my local Mac so that it matched my remote server. BUT, homebrew didn’t support Unison 2.48.4.

So, after getting some feedback from one of my coworkers, we came up with the following. Maybe you’ll find it helpful.

# Get rid of existing Unison
brew uninstall --force unison

# Checkout version of homebrew with Unison 2.48.4
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
git checkout 05460e0bf3ae5f1a15ae40315940b2d39dd6ac52 Formula/unison.rb

# Install
brew install --force-bottle unison

# Set homebrew-core back to normal
git checkout master
git reset HEAD .
git checkout -- .

NOTE: If you get error: fatal: reference is not a tree: 05460e0bf3ae5f1a15ae40315940b2d39dd6ac52 after running git checkout 05460e0bf3ae5f1a15ae40315940b2d39dd6ac52 Formula/unison.rb, we’ve been able to fix the issue by recloning homebrew-core. If you get the same error, you’ll want to add these steps before retrying starting at the git checkout 05460e0bf3ae5f1a15ae40315940b2d39dd6ac52 Formula/unison.rb command above.

cd /usr/local/Homebrew/Library/Taps/homebrew
rm -rf homebrew-core
git clone https://github.com/Homebrew/homebrew-core.git
cd homebrew-core