It’s a common scenario: you’re tracking your bank and credit card transactions using something like Mint, or Quicken, or my favorite at the moment, You Need A Budget (YNAB). You’re also living with someone, and splitting the cost of certain things, like groceries and utilities. Maybe you’re using a tool like Splitwise to keep track of these shared expenses. So far so good.
But now you want to try and monitor how much you’re spending in certain categories each month, and so there’s a problem. You paid all the utility bills this month, and your roommate bought all the groceries. In Splitwise, the expenses balance out pretty well, but in YNAB, it looks like you spent a ton of money on electricity and Internet, but nothing on food. So how do you incorporate these outflows into your budget that aren’t reflected in your own financial transactions?
If there’s a super quick, automatic way to do it, I don’t know it. However, I’ve come up with a method that works fairly well with a little bit of data entry, and it’s pretty easy once you get the hang of it. Here’s the gist of it: Continue reading
Say you have built a really amazing WordPress theme, and have enabled its users to tailor it to suit their needs with a really amazing custom section in the Theme Customizer (that you put together after following one or more of these Theme Customizer tutorials):
Well, the theme really takes off, enough so that at the next WordCamp, people are coming up and complimenting you on your great work. Then one particularly enthusiastic blogger shakes your hand and says, “You know, I really love how you let users customize The Important Stuff, but I’m a little confused about the Fox setting. I’ve watched that video at least 100 times now, and at no point is the guy with the ears singing about ossifers or, uh, alfalfa, or whatever.”
“Oh!” you say. “Oss-en-fay. Sha fafa. Those are for the Frim Fram Sauce.”
At which point the blogger, misinterpreting your explanation, backs away slowly before turning and running over to the event security booth. Meanwhile you are sitting there lamenting the fact that there’s no good method for visually separating and labeling checkbox controls in a way that is consistent with the other available types of controls in the Customizer.
Fortunately, I have a solution to the problem in this highly realistic scenario. You can create a custom control that doesn’t actually control a setting, and have it output arbitrary HTML into your Theme Customizer section. Here’s what the control looks like: Continue reading
I ran into a problem today where I ran
vagrant up after suspending the box last night, and instead of starting the existing box back up, it started building a whole new one. I cussed a lot. Then I checked the Virtualbox console, which told me that the old one was still there, but Vagrant couldn’t see it anymore. The thought of having to rebuild and provision everything in my development environment inspired me to cuss some more.
Fortunately, after getting a cup of coffee and doing some forum research, I found a likely explanation and a way to retrieve my lost box (which I’ll get to in a sec): Apparently the Virtualbox app froze or otherwise didn’t respond in a timely manner, so Vagrant assumed the box no longer existed and decided to start from scratch. Here are two lessons from this experience:
- If you’ve suspended your VM, use
resume instead of
up to get it going again, because it won’t make bad assumptions. If Virtualbox isn’t responding,
resume will just give up and tell you it’s moving on.
- Re-associating the box with Vagrant isn’t actually that hard. I just had to determine the machine ID of the VM, then go to the
.vagrant directory and put it in a file called
id. This thread on the Vagrant GitHub repo walks you through it.
Immediately upon releasing version 1.0 of Columns DIY, my first plugin in the WordPress repository, I realized my shortcode was missing a fairly important parameter. Well, that was like 8 months ago. Today I finally remedied that situation, and took the opportunity to add a few other small enhancements while I was at it.
Version 1.1 basically has three changes:
- It now has the rowstyle shortcode parameter, so you can add inline styles to the row container
div. Of course, it’s still better to put the styles in a CSS file and add classes instead…
- There are now several filter hooks so you can modify various parts of the shortcode output. For example, you could change the nested div structure to an unordered list, or you could add a custom class to columns on posts in a certain category.
- The third thing is more under-the-hood, but I changed the way it cleans up errant
<br> that WordPress’s
wpautop function adds around the shortcode before it gets processed. Before it basically parsed the entire post content, regardless of whether the
'column' shortcode was even there. This was a terrible idea for many reasons. Now it specifically looks for patterns involving
'column', and leaves everything else alone.
Recently, during a break in the weather, I went for a walk on Seaside Beach. The sun was out, the wind was calm, and … the day was a complete anomaly for January. Maybe the months of dreary gray rainstorms, long nights, and gale-force winds addled my brain, but I became mesmerized by the intricate patterns left in the sand as receding waves washed around shells, rocks, and other immobile beach objects. The bright sunlight added extra relief to the topography, which reminded me of aerial photography I’d seen of the gullies and ridges of arid landscapes.
So, I took out my iPhone with its 8-megapixel camera and began shambling down the beach, bent over double, snapping my own micro-aerial photos. I was so pleased with the results when I got home that I took a few of the best ones, and after optimizing their exposure and contrast, uploaded them to a new Imagekind account.
Here they are: Continue reading
Last weekend was WordPress-saturated, starting with WordCamp Portland on Saturday, followed by Dev Day on Sunday. It was my second WordCamp and my first Dev Day, and I enjoyed both.
Dev Day in particular was edifying, because I learned how to get involved with contributing to WordPress core and got a tutorial on using Subversion. This in turn inspired me to finally submit a plugin to the WordPress repository.
Columns DIY is super simple: it creates two shortcodes that can be used to wrap content in row and column divs. Then you provide your own CSS styles to give the divs any layout and appearance you desire (thus the “DIY”). I wrote it because every other columns shortcode I could find included a bunch of styling that I didn’t want. After I’d used it on a couple of sites I was building, I put it up on GitHub because I figured there must be other developers out there who would appreciate quick, well-formed HTML for columns without having out-of-context CSS foisted on their design.
Here’s an example:
- Includes enumerated column and row classes, allowing for per-column and -row styling. Also includes parity classes (odd/even) for striping.
- If a user forgets to add the last
'endrow' shortcode, the plugin will automatically insert a closing
</div> so the site layout doesn’t get broken.
- Cleans up errant
</p> tags that result from WordPress’s
- All parameter inputs are escaped for security.
The following optional parameters can be added to the
- class (String : ”) Classes for the column
<div> element. Separate multiple classes with spaces.
- rowclass (String : ”) Classes for the row
<div> element. Only works when included with the first
'column' shortcode in a row.
- style (String : ”) Inline styles for the column
- norow (Boolean : false) Set to true to omit the row wrapper
… and I can already see that I need to add a rowstyle parameter. Hah.