Being an Ally

It’s even more important than usual for privileged allies to be good allies right now.  I’m “safe” compared to many others since it’s my beliefs that are under attack, not me as a person. Being a good ally isn’t easy; I know I get things wrong. But here is what I am trying to do in order to be a good ally online.

  1. Amplify the voices that aren’t being heard.  I’m trying to make sure that if a marginalized person says something I think is worth being heard that I share it.
  2. Be a little less worried about being a white knight and come to the defense of marginalized people that are attacked. I’m making sure I don’t talk over people. And I’m trying to be respectful.
  3. Thanking, congratulating and supporting. It’s not easy to be on the front lines and so when people are, I’m trying to make sure they know the work they do is appreciated.

In person, I’m trying to be an emotional support person for friends that need it. I’m wearing my feminist shirts to show other men that there it’s ok to be feminist.

Also, every time I get really pissed off, I donate to Planned Parenthood, the ACLU, and other organizations to make sure they can do the work the country needs them to do.

I’m sure I can do more, and I’ll figure out how.  But for now, that’s me.  What are you doing to be an ally?

Some Recent Paintings

I’ve been continuing to have fun with watercolors.  I find the process of creating something tangible to be a nice contrast with the majority of my day where I am creating digital things.

My friend Brian celebrated the second anniversary of the Post Status Club where he provides excellent news and insight for the WordPress community along with a clubhouse for to gather (in this case, slack).  To commemorate it, I made a little painting

I’ve also been spending a lot of time thinking about the concept of Love and the power it has to shine through.  It’s also a universal concept.  Love exists everywhere and in many different forms.  This painting is part of a larger series that explores that idea.

 

Commit Messages are about Intent

Commit messages are user experience for developers.  Both for other developers active right now and for developers (including ourselves) days/years/months from now. Think about the last time you were looking at a piece of code and asked yourself “Why is this here”.  This is for you, this is your experience. I shared my four rules of thumb for commit messages, this is a little more in-depth.

Caleb Thompson proposes three questions that all commit messages should answer:

  • Why is this change necessary?

  • How does it address the issue?

  • What side effects does this change have?

In general, the first and second is the easiest to answer. In many cases, a link to your bug tracker will suffice (at least in part) for the first question. Your bug tracker should already contain the *why* for every change requested. The second question  is important when the solution is complex.

Does this mean that all commit messages need to be bland? Absolutely not. WORLD WAR Z-INDEX: Restoration of sanity to revisions/slider/menu z-index values. is an excellent example of a commit message that is both fun and informative. The changeset is small ( 3 lines changed, 4 deleted), and is fairly easy for us to answer the question “What is changed?”. The why is answered with both a link to the ticket of

Erlang/OTP identifies three important purposes that commit messages serve:

Good commit messages serve at least three important purposes:

  • To speed up the reviewing process.
  • To help us write a good release note.
  • To help the future maintainers of Erlang/OTP (it could be you!), say five years into the future, to find out why a particular change was made to the code or why a specific feature was added.

The third reason to me is likely the most important.  Boone Gorges identifies blaming and annotation to be important tools in understanding the history of code and history of decisions in his talk Building a Better WordPress through Software Archaeology. Our software has a history and commit messages are the first draft of that history.

 

Further reading:

Commit Often, Perfect Later, Publish Once: Git Best Practices

Best Practices vary from environment to environment, and there is no One True Answer, but still, this represents a consensus from #git and in some cases helps you frame the discussion for the generation of your very own best practices.

On commit messages

Any software project is a collaborative project. It has at least two developers, the original developer and the original developer a few weeks or months later when the train of thought has long left the station. This later self needs to reestablish the context of a particular piece of code each time a new bug occurs or a new feature needs to be implemented.

5 Useful Tips For A Better Commit Message 

Having a story in your git log will make a huge difference in how you and others perceive your project. By taking great care in commit messages, as you do in your code, you will help to increase overall quality.

The Art of the Commit

Think of the commit log as a newsfeed for your project, in which the log message is the headline for each commit. Have you ever skimmed the headlines in a newspaper (or, for a more current example, BuzzFeed) and come away thinking you’d gotten a summary of what was happening in the world? A good headline doesn’t have to tell the whole story, but it should tell you enough to know what the story is about before you read it.

New BASH Prompt

For the last few years, I’ve been using impromptu for setting my bash prompt. However, it felt in perpetual beta status and I wanted to try out something new, so today I installed bash-git-prompt and am giving it a try.

It was super easy to get started with it following the instructions.

  • Run brew update
  • Run brew install bash-git-prompt for the last stable release or brew install --HEAD bash-git-prompt for the latest version directly from the repository
  • Now you can source the file in your ~/.bash_profile as follows:
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then
  __GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share
  source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
fi

So far, it seems like something that should do the job. If not, I’ll look for a new solution. Let me know in the comments how you setup and manage your prompt.

WordPress JSHint Adventure

NOTE: I found this draft originally written on December 19, 2013.  Not sure why I decided it should remain unpublished, but I did and then like many drafts, I forgot about it.  So here it is.


One of the features of WordPress 3.8 is something that users will never notice. In fact, it’s something that most developers will never notice as well. It was establishing greater standards with the core JavaScript and adding JSHint.

JSHint is a tool that detects errors and potential problems with JavaScript code. They range from the annoying ( trailing whitespace ), to the potential bug inducing ( code in a function after a return ), to the likely to break a browser we still support ( a trailing comma in an object ). Adding JSHint was initially discussed around the same time as the creation of http://develop.svn.wordpress.org, but it wasn’t until the start of the WordPress 3.8 that much progress was made. K. Adam White led the effort to create the initial .jshintrc (which is the configuration JSHint uses) along with the grunt configuration to make running JSHint easy.

Once the configuration was decided upon, the process of fixing up the files was relatively quick and straightforward. A list was built and maintained of all files, and then edited to note the person who signed up to fix it and the ticket number.  Overall, from publishing the post until the last file was cleaned up it took 7 days.

By going file by file, we minimized the churn and made it simple for committers to review. It also made it easy to find bitesize chunks. Overall, 13 individuals wrote patches in addition to the committers who assisted.

Bash Functions I use for access logs

The command line is my IDE.  Vim is my editor and all the functions and programs in bash help me be a better developer.  As much time as I am writing code though, I also am often spending a lot of time looking through logs to see what is going on.  Over the last five to ten years I’ve collected a number of bash functions to help make working with access log files easier. Some are stolen from my old coworker Drew, others from various places online, and others I’ve cobbled together.

function fawk {
    first="awk '{print "
    last="}'"
    cmd="${first}\$${1}${last}"
    eval $cmd
}

This simple function allows me to pull one whitespace broken element out. Imagine an access file filled with lines like:

172.16.194.2 - - [13/Jan/2017:14:55:31 -0500] "GET /infidelity-husband-had-affair/ HTTP/1.1" 200 20685 "https://www.google.com/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36" "1.1.1.1, 2.2.2.2, 127.0.0.1, 127.0.0.1"

I can run cat access.log | fawk 7 to pull out the urls. I can further pipe that to sort | uniq -c | sort -nr | head to pull out the most popular urls. I also have a function for visualizing these results.

function histogram {
 UNIT=$1
 if [ -z "$UNIT" ]; then
 UNIT="1";
 fi

 first="sort|uniq -c|awk '{printf(\"\n%s \", \$0); for (i =0; i<\$1; i=i+"
 last=") {printf(\"#\")};}'; echo \"\""
 cmd="${first}${UNIT}${last}"
 eval $cmd
}

For example, If I want to see all the response codes, of the last 500 responses I can do something like

tail -n 500 nginx/access.log | fawk 9 | histogram 10

 466 200 ###############################################
 8 301 #
 5 302 #
 1 304 #
 18 404 ##
 2 429 #

I often want to look at more than one access log at a time, but they are gzipped to save space after rotating. I have a function to cat or zcat all of them.

# cat or zcat all the access logs in a folder 
# Pass in folder to search in as the only param
# Likely want > into another file for further use
access_concat(){
	find $1 -name "acc*" -not -name "*.gz" -exec cat '{}' \;
	find $1 -name "acc*" -name "*.gz" -exec zcat '{}' \;
}

When it comes to working across many servers, I still rely on dancers shell in concert with these functions.  The occasional access log spelunking is much easier with these tools.

Omnivore normative behavior

When reading about responsive web design, you’ll often come across the term “Hamburger Menu” and it will sometimes make me hungry. But it won’t make everyone hungry. It won’t make vegetarians hungry.  Nor pescetarians.

We live in an omnivore normative society where the assumption is often made that meat eating is normal and all else is the exception. Damn Omnivore Normative Behavior.

Take the Time to Use Fewer Words – Microsoft Design 

Using fewer words isn’t a panacea to fix every user experience; it’s just one guideline, together with all the others employed by excellent writers, designers, developers, program managers, and researchers. It’s how UX writers reduce the text to create experiences that let people to do more of what they want to do — not waste their time reading explanations of how to do it.

Source: Take the Time to Use Fewer Words – Microsoft Design – Medium

Dark enough to see the stars

Every year, on the day we celebrate Dr. King, I listen to his final speech.  And each year, it’s a different line that stands out to me. This year, it was near the beginning when Dr. King is answering the question about “which age would you like to live in?” and after going from ancient Egypt, to Greece, all the way up until the time that he is living and says that is when he would like to live since:

The nation is sick. Trouble is in the land; confusion all around. That’s a strange statement. But I know, somehow, that only when it is dark enough can you see the stars.

— Martin Luther King, Jr. “I’ve Been to the Mountaintop”
3 April 1968, Memphis, Tennessee

The nation was sick then and it is still sick.  Some of the symptoms are treated, but we haven’t cured the illnesses that hurt our country. We haven’t ended poverty, which Dr. King laid out a great vision for solving. Nor have we ended systemic racism, sexism, heteronormativity, transphobia, and all the other ills that make this a dark time. But only when it is dark enough can you see the stars.

The stars to me that I’ve seen are an LGBT+Allies party at WordCamp US that saw a packed bar and exceeded everyone’s expectation. The stars for me are seeing thousands of woman preparing to march in support of woman’s rights. The stars that I’ve seen are Biloxi, Mississippi deciding to officially celebrate Dr. King’s birthday as his birthday.

It’s only when it is dark enough can you see the stars.

There is sure to be plenty of darkness in the coming years.  The darkness never went away, but it’s through this darkness that we can see the stars and it’s these stars that make now a great time to be alive.

Listen to “I’ve been to the Mountaintop”. It may help you find the stars in the dark.