Be Nice

There’s a lot of talk about sexism in tech. For the most part I shut it out, even the sincerest stories tend to irritate me. But I think that’s to do with my own feelings on the subject – particularly, that I don’t really know what they are.

Having taken a brief moment to consider it, here’s my position (Spoiler alert: this applies to a lot more than just sexism in tech): be nice.

That’s all I wanted to write on the subject. Two words. But people love rules. Or rather, people love to find the exceptions and loopholes that rules beget. So I wrote some other words. (more…)

Turn That Snippet Into A Plugin

This post is sort of a recap of a talk I gave a couple years ago.

Whenever you get a WordPress code snippet, where do you put it? It’s not uncommon all those bits of code to end up cluttering up the functions.php file of your theme, whether out of habit or suggested by tutorials.

But wouldn’t it be better if all those non-theme snippets were plugins instead? Yes!

As plugins, you can switch/upgrade themes without losing that functionality and toggle the funtionality without editing the theme.

And great news! It’s really easy to turn a snippet into a plugin.
(more…)

Things You Should Know About the Command Line

The command line is really powerful and there are a quite a few things made easier by using it.

When I started learning things, I did a lot of copy-and-paste. It got the job done (usually…), but I rarely understood what I was doing or why it worked. So I want to outline a handful of basic commands, and some tips and tricks.
(more…)

Personal Project Sprint

Here’s the deal — I’m really good at making lists… but in quantity not quality. I can make a dozen or more to-do lists between assorted notebooks, sticky notes, email, Evernote, Trello, and who-knows-what-else. (I’ve created a super simple list tool that I’m hoping will help combat that problem)

But I’m not always very good at following through with the tasks. Lists from 6 months ago might be the same as a list I jotted this morning. That’s right, I still haven’t cleaned up my worktable, or fixed that bug in that code…

Some I’m issuing this challenge to myself:
get as much done on my projects and to-dos as possible during April.
(more…)

Nginx, robots.txt, and Copy-Pasta

Did you know that if you don’t have an actual robots.txt file, WordPress will create a virtual one for you? For example, I have not created a robots file for trepmal.com, yet you can see one at https://trepmal.com/robots.txt.

So either you have created your own file, or you’re relying on the virtual one. Unless you’ve explicitly disabled WordPress virtual robots.txt file, you’ll have something at yoursite.com/robots.txt

However, if you (1) use nginx, and if you (2) followed certain popular guidelines* for configuring your site, and if you (2) are relying on the virtual file, you might discover that you get a 404 if you try to view your robots file.

(more…)

WP-CLI in the Real World

I’m looking to spread the word about WP-CLI. One way I’ve decided to do this is to submit a WordCamp talk proposal on the subject.

Of course I can talk about how I’ve benefitted and about my favorite things, but I’d really like to make sure my talk is well-rounded and takes into account real world usage. Basically, I would love to hear from you about your experiences with WP-CLI.

  • Biggest hurdle to overcome?
  • Favorite command?
  • Most irritating aspect?
  • That feature you’re looking forward to using?
  • When did WP-CLI save you hours on a project?
  • Did it teach you something?
  • something else?

Whether there’s something you want to learn or a tip to want to pass on, let me know in the comments!

Automating Backups to Amazon S3

My Setup & Prerequisites

I’ve got a LEMP stack, that is Linux (ubuntu), Nginx, MySQL, and PHP. It’s pretty common, but this should also work just fine for other LAMP stacks.

I want to backup some databases as well as web files, including some non-WordPress stuff.

There are tools out there like BackupBuddy that might be perfectly sufficient for your needs, especially if you want access to support forums and such.

But I like to dig into server-y stuff. Doing it this way will require a few things

  • ssh access to your server
  • sudo permissions (usually…)
  • amazon s3 account
  • some basic familiarity with the command line

(more…)