Desk Simplicity

My Desk

I <3 Simplicity

Nginx and Post Preview (Preview Changes) not working [DigitalOcean]

Recently I have been experiencing an issue with Preview Changes not working in WordPress on a Nginx VPS over at DigitalOcean. I use a few common config files from nginx-common-config. Before, the configuration did not fix the problem, but after it did. Thanks to the /VVV guys for a configuration that solved the problem.

To fix you can just clone down nginx-common-config and include the nginx.wp.conf file.

How to create a stroke around a number with CSS

I recently had to find out how to do this while working on a site a couple weeks ago and thought I’d share. So, what we’re making is this.

Screen Shot 2014-10-26 at 9.25.07 PM


From the above HTML you can see we first create three layers:

  1. a background (black solid background with rounded corners)
  2. a stroke (a white circle)
  3. another inner-circle with a number in it (black circle inside of the white one


There are essentially three layers here. The background is an obvious one. The stroke is a white background <div> that is made into a circle with border-radius and some padding. This allows us to fit the inner circle (also a <div> made into a circle)  into the previous white circle which creates the illusion of a stroke with some padding. So, black square, white circle (with padding), black circle.

You can fiddle with this.

Feature Table

Feature Table

Feature Table

I’ve been working on a new re-vamp of the RapidMapper site and I just got done creating a shortcode-based Feature table. that I was pretty happy with. I’m hoping to post how I made those number-circle-things using only CSS.

How to create a great mobile wp-config.php file for local, staging, and production environments (How I do it anyways)

Pencil Light for WordPress

Pencil Light Atom Theme

Pencil Light Atom Theme

I recently started using a great theme in my Atom Editor called Pencil Light. I loved it so much I took my beloved Wilson theme and re-themed it to be Pencil Light for WordPress.

I can’t wait to get it through theme review and get it on the WordPress Theme repo. I hope Anders Noren doesn’t mind.

Do you spend a lot of time doing task management as a Developer?

I spend a lot of time tracking what I need to do, we’ll call that “task management.” Be it work or play I always spend what I feel is an inappropriate amount of time tracking my tasks, issue trackers, emails, and planning. All my ducks seem to need to be in a row before I actually pull up my text editor and churn out some code.

I was wondering if this is simply just a normal part of being a developer, or if I have OCD.

Let’s just look at the process it took me to patch

  1. When I had the idea, I of course had to add it to my Wunderlist ‘’ and write out my idea
  2. I had to make sure I knew what to do and created a few subtasks: Test it, Patch It, Report it
  3. I pondered whether or not I should also track these as issues on my fork
  4. I decided not to, but if this had been a development project I would have just so that issue is also out there on that repo (maybe a little OCD)
  5. I went through each sub-task and ended up creating a slew of patches
  6. Someone reported that themes would also need to be patched
  7. I spend a couple minutes pondering whether or not I should add that as a sub-task or not
  8. I concluded that the task ‘Plugins should not load when the plugins page is loaded’ had to do with plugins
  9. So, I created ‘Patch so themes are not loaded using _wp_dont_load_functions’ to address that

Now, multiply that times the hundreds of tasks I probably will do this week and you can see the dilemma. #5 is where the work really was done.

Do you spend a lot of time around task-management? Did you? Any tips? Any pills I can take?


“I think freedom is when you’re not attached to anything.” – Laura Dekker, Maindentrip; on Netflix

Copy & Paste not working in iTerm2 using Vim and system keyboard? [Fix]

See ‘Edit: Use both!’ below.

I recently started using Vim (or MacVim) in my terminal instead of letting MacVim open in a new window. The reason was that when I’d exit via :q I would not exit to the terminal, where I could then git status then edit another file. I just wanted to stick to the terminal window.

So, first off I started using MacVim instead of Vim. I know this sounds confusing, but if you run Vim via vim file.php, you are missing out on some cool MacVim stuff. To run MacVim in the terminal (doesn’t open a new window) use mvim -v which runs it in the terminal. So, when you exit using :q you return to the prompt. Dandy.

Now, once I did this I was immensely annoyed. Using Command-c in iTerm2 was not working, it would not copy to the system keyboard. I also have set clipboard=unnamed set in my .vimrc so a yy should copy a line directly to my system clipboard, but no.

After an hour of digging, I found the culprit. You see, I also use set mouse=a in my .vimrc, this allows me to put the cursor where I want in the terminal.

Placing my cursor anywhere in Vim

Now this behavior is only available because the option Enable xterm mouse reporting in your profile is enabled. I found that disabling this option disables the set mouse=a option (you can’t move the cursor around using the mouse), but it does allow you to use Command-c and Command-p reliably (in my case goes to system clipboard).

The iTerm Option that disabled copy and paste in Vim

I should be more ninja-like and stop using my mouse cursor to do the talking in my terminal anyways, so disabling it didn’t bother me that much and let me use MacVim more comfortably with my clipboard. I hope this helps someone, it was super-annoying and wasn’t easy to figure out.

Edit: Use both!

Note, minutes after posting this I was also able to retain my set mouse=a behavior and get Copy/Paste behavior to act as expected. This was done by enabling Use modern parser (experimental) in iTerm2, which allowed me to also enable Enable xterm mouse reporting and my yy‘s copied to my system clipboard.


Spider Ninja

Play any song to these, they will dance to the beat of any song! Here’s one below.

Plugins shouldn’t load on the Plugins page in WordPress

I had a thought today, wondering if plugins actually did load on the plugins page in WordPress. If they do, I don’t think they should! Plugins should always be manageable from the WordPress Admin. Yeah, maybe a plugin breaks a few admin pages, but it shouldn’t, at least, break the plugins page, that way it can be navigated to manually, and plugins can be deactivated, managed, etc.

Same for themes. I’m going to do some investigating.

7 Discipline-Mastering Practices

“Do the task even when I’m not in the Mood,” 7 Discipline-Mastering Practices

Firebug vs. Firefox DevTools

I’m exploring which development tools to use in Firefox now that I’m considering a switch back. Come join the conversation about Firebug and Firefox DevTools! Which is best?

It is your resistance to what is…

It is your resistance to what is that causes your suffering.


What is Suffering? What is Happiness? What is the Middle Way?

What is Suffering? The pursuit of satisfaction.

What is Happiness? The absence of suffering.

What is the Middle Way? Experiencing satisfaction and dissatisfaction as they come, neither pursuing or avoiding.


I feel like I’ve dropped off the face of the planet. I haven’t done any WordPress-y stuff, haven’t been up late coding a new plugin, nothing, nata.

Today I did, however, have some time to re-do my site. It’s now called because, on an impulse, I bought a domain ( with the same syntax that you can now use to get to this site (you may already have). While I was doing some cleaning up, I noticed this post needed a new category. Fatherhood. Yep, this is the reason I haven’t been on here in a while- I’m about to be a dad. It’s insanely great as I sit here waiting (could be any day now) for a child to pop out and let me be a dad!

I’m glad I got to press this moment on my blog before I forgot to. Maybe this is a good start to a Dad Blog!

VaryingVagrantVagrants for WordPress Theme Reviews

I created a VarryingVagrantVagrants setup for testing and reviewing WordPress Themes I’d like to share with other theme reviewers.

I hope it helps.

VaryingVagrantVagrants Setup for Reviewing and Testing WordPress Themes

Hash 1.1: IRC/HipChat-like chat system built on PHP, jQuery, HTML, & CSS

First off, this is my first post about Hash, a “secret” chat project I’ve been working on to replace my personal IRC woes (mainly IRC logging). Don’t get me wrong, I love IRC, but I also love HipChat, but I hate that HipChat list closed….you get the point. Plus I needed something dead simple, no logins, no signups, just chat…

Hash is a simple IRC-like, HipChat-like (mainly in that it has persistent chat), (PHP, jQuery, HTML/CSS)-based chat system. So anyone can use a Hash install to use.

Screenshot showing Hash collecting nick and hash names

Here’s how it works. All you do is create a room (which I call a hash, because you hash things out), and pick a nick. No login. No password, in fact two people (at the moment) could use a single nick or login as many. Then, chat. Notifications let you know when something new is said. Chat history is persistent.

It’s developer friendly, which only really means it’s easy to create rooms, share them, and assign people nicks because the chat uses ?hash=&nick= to start the person loading the hash off with a hash and a nick. Easy for inviting clients into chat rooms by just giving them a link.

Hash 1.1 will continue to make small improvements to make Hash more useful. I have been using it, and it appears to be stable enough to use, again for private purposes. Not sure about public use yet, but I need it for a few new things, and so 1.1 will get those features.

You can try out Hash on my site where you can make a hash and start chatting away with someone else. I’d love to see people use it and give feedback.

Want to help? Check out Hash on Github. There are some issues that need some help.


First of all, this is a proposal. I just want to solve a few simple problems with this:

  1. Ticket #25295
  2. Personal experience with clients using WordPress can’t get how to use <br> in HTML mode, but can use a shortcode like [br] or [break], or [break clear-left] better
  3. I want to wrap a <div> around an element, but possible cuts and paste’s can erase it because the code isn’t seen in visual
  4. When I do add a <div style="float:right"> around an element in the editor, it actually happens in the editor. Sometimes this is nice, sometimes this sucks

…this seems like a solution to some of these issues because I have used these kinds of solutions before in themes and plugins to help clients and myself do more HTML-y things in the editor. I just want to build an all-in-one solution.

Follow #shortcodeml on my blog for updates.

Let’s see if I can sort this out. Because of ticket #25295, and the fact that 3.9 will most-likely not have the “Advanced” tab when editing an image’s properties, we will sadly no longer to be able to click on an image, go to Advanced, and, for instance, add class names like  .aligntop to an image.

I don’t think this should be done in the Advanced tab anyways. Sure, for images, it’s a quick way to do it, but if you really want to add a class to something, you’re going to use the text mode to do it (especially for something like a div or ul).

This ticket gave me the idea to write something close to bbScript, remember bbScript?

“Wouldn’t it be nice to just [code]...[/code]?”

Let’s add on to the image problem and say that, yeah, we also can’t add a break return without sending the user into text mode in the editor and having them write <br>, which when switching back to Visual isn’t apparent that it’s there. It’s kind-of invisible. What if we could  [br] instead, or [break], which is more understandable and readable, or  [break clear left] to also clear left (we should also be able to [br style="clear:left"] because some of us are more familiar with HTML. It’s also hard to, in the editor, wrap <code> around a piece of text. I’m currently using a plugin, but wouldn’t it be nice to just [code]...[/code]?

That’s where the idea of a plugin, that I’m calling ShortcodeML, would allow us to do more HTML-y things in the editor and solve our ticket problem because we can just [span class="aligntop"]<img />[/span] or [class="aligntop" block]<img />[/class]. And for an intermediate WordPress user, this isn’t HTML, because you can see it, and it’s readable, and it’s a shortcode.

Organize the Idea

I didn’t want to go find some large list of HTML tags and kill myself coding each one. I wanted to do something more graceful and simple that solves the problems. First off, we only need a few HTML elements (I’m open to additions) to work with in the editor (tag|readable):








All of these only need to accept a few helpful attributes (attribute|readable attribute):

[... class|classes=""]

[... style|css=""]

[... id=""]

Data attribute can be handled like:

[... data="value", data-selector="x"]

Gives us… <span data-x="value">...

We are also going to need some handy quick writable tags where “…” below are any of our tags above. Some elements may not need a “tag”, so “…” will not be included:

[... clear-left|right|both]

Gives us…: <... style="clear:left|right|both;


Gives us…: <span style="clear:left|right|both;


Gives us…: <span style="display:none|inline|block|inline-block;

[... inline|block|inline-block|hidden]

Gives us…: <... style="display:inline|block|inline-block|none"

[class='classes classes2']

Gives us…: <span class="classes classes2"

Some examples:

[paragraph clear-left]...[/p]


[inline class="classname"]

[divider inline clear-left css="margin-top:20px"]...[/p]

[break clear-both hidden]

[class="aligntop" block]...[/class]


So, that’s my idea and what I’d like to start building. If you have any feedback, ideas, modifications, whatever, please comment!

#wcphx: What I took away from my first WordCamp

WordCamp Phoenix Logo

So, I’ve been waiting all day to write this blog! The last day of WordCamp Phoenix was awesome! I’d have to say the contributor sessions today were great and really brought home WordCamp for me!

Google Destination URL

I’ve also completed my goal of publishing a plugin during WordCamp Phoenix. You can now use Google Destination URL by installing from the repository. I tried to use as many things I learned at WCPHX while developing it. You can see more about the process from the GitHub commits.

Google Destination URL will allow you to add link in the WordPress editor by searching Google for the link. Check it out.

But! The other part I wanted to blog about was, “What did I learn at WordCamp Phoenix?” I’m going to cover the stuff I’ve retained; the stuff that really stuck out. Let’s start with…

Day 1

The first day was, obviously, my first time at a WordCamp. But, right away I was learning new things! I really think most people owe it to themselves (as a developer) to learn things from going to WordCamp.

During day 1 I learned more about the things that I didn’t know much about before, or didn’t use as much. It was the most informal day for me. The best part was when Konstantin Obenland and Michael Cain did “Cain and Obenland in the Morning” talk-show like event. But it was also awesome to learn some cool stuff from Brad Parbs and Cliff Seal.

Where to always use filters: return;

Brad Parbs told me this one.

The first thing I learned was something that felt like something I should have considered or thought of before. When you’re returning a value from a function, you can automatically give other developers an automatic advantage by allowing someone to hook into the values you are returning. Now I can use filters easily.

I kind-of show how you can do this in this example:

Send PHP data to JS using  wp_localize_script

How I’ve usually accomplished this is by embedding an inline script to set a JS variable with values in it. Turns out WordPress already does this quite well.

In these examples you can see how I setup a JS var called google_destination_url_js on the PHP side.

Using Transients for Caching

Cliff Seal showed us this one.

I had known about transients before WCPHX, but I never really thought about how to use them. In the example below I show you how I cached Google Search results in my new plugin.

If you were to type aubrey, and then modify what you typed to aubrie, the search (on keyup) will return another result (the same result) for a, u, b, and r all over again, even though you already typed each of those chars less than a second ago (while typing).

You can see what I mean in the examples below. I cache each keyup result so that, if the delete button is hit and aub is typed twice in two different searches, we are bugging the Google API once for a, au, and aub.

Day 2

Day 2 was one of those days when I just couldn’t decide what talk I wanted to attend. They were themed into 3 groups, one was client/beginner based, the next business based, and the last one developer based. I would get stuck trying to decide, WordPress Mobile App Development, or Managing Client Expectations from Start to Finish?

Some things I took away from Day 2…

Turn down work that isn’t for you or your company

It’s pretty self explanatory, but I heard this talked about and said so much on Day 2 that it became obvious that taking on work that doesn’t fit your style or company just spells disaster.

You can make Apps out of your WordPress sites

I always knew that there might be a way to do this, but one of the talks that day confirmed for me that, indeed, it can be done.

Look into AppPresser for more info.

I’m still not ready for Capistrano

Though the talk was really good, using Capistrano still frightens me haha! It was probably the only talk where I felt like it would be easier to just make the symlink myself.

Paul Clark Still uses MAMP, and that’s OK! (Varying Vagrant Vagrants)

Throughout the camp, people were raving about VVV (Varying Vagrant Vagrants). Now, it doesn’t frighten me as much as using Capistrano, but I’ve just always just trusted MAMP. But, like I said, Paul Clark said he still uses MAMP, and know what, so do I.

Varying Vagrant Vagrants is from the guys at 10up.

Day 3 (today)

Day 3 is probably my favorite day. I spend all day in a small room with a bunch of other WordPress loving people. The day wasn’t about making money off Websites, or how to use new API’s, etc, it was about the thing I love about WordPress: contributing.

And, the things I took away are:

WordPress people want YOU to get involved

The overall feeling I got from the people in this particular part of the camp was that they really really want people to get involved. It may look like the WordPress god’s in IRC or Make don’t really need your help, but you’d be wrong.

WordPress people are so welcoming to people who want to help, but you kind of got to get in there and let them know. I asked a few questions about how to really get in there and start working on things, and it turns out that if you just show up, you’re probably on the list! But, you need to…

Ask Questions or Get Help!

There were tons of WordPress people that said, “please, tweet me, I will help you out,” the whole time I was there. Brave up, ask questions, bug someone (but be nice).

I plan on bugging Mike Schroder on how to get involved in core…well…because he told me to.

The new way to build new things for core is build a plugin

I asked about how to get involved in building new features, and the experiment with MP6 is still on-going. There are people (and teams) who are devising plans to get new things into core today! They build a plugin, everyone checks it out, and walla it’s in core (or not).

But, if it doesn’t make it, hey it’s still a plugin…Beautiful!

The key is getting in touch with these teams. IRC is the sure way to get involved, and get involved today! Now is the time to do it (as of January). They are working on building teams for 3.9!

And, finally…

The overall thing I took away from the camp is that there is a community. From the far reaches of the inter-webs it may seem like there are a lot of hidden people working on WordPress that don’t need your help. Being my first WordCamp, I came from a place where I knew I could get involved, but (I don’t know how to explain it) there was just something missing…

…It was going to a WordCamp! You’re going to meet those people, put some faces on them, and get a renewed sense to get involved!

WordCamps are also a great place to learn the ropes. Sure you can read up on things, and like me learn through experience, but the “pros” at WordCamps will show you how to box with your gloves off. Plus it’s just an eye-opener. You’ll hear and see things you hadn’t before…promise.

Well, that’s pretty much it! The great people who made WordCamp Phoenix happen deserve more recognition that they probably get! I’ll be coming back next year, I might also be going to other one’s too, who knows!

What did you get out of it!?