I occasionally run into weird permission problems after a restore of files and folders on my machine, I think it has to do with OSX trying to protect me from myself.
Today I needed to fire up my coding environment on my Mac Mini, so I jumped into the folder for the code that I wanted to update using SourceTree, and did (what I thought was going to be) a quick pull, only to get a weird error message.
Sometimes I get my branch in a state where I need to reset things to what is on the server. Most of the time a simple switch of branches is enough to get everything back in shape, but once in a while I need to actually reset to what is in the parent repo.
To reset your local working copy to exactly what is in the remote (typically called origin) do the following:
I needed to do some work on an old Maven project I have that I’ve worked on for years, and when I fired up my handy Netbeans IDE and ran the obligatory “priming build”, I was surprised to get an error on one of the basic Maven plugins. Continue reading →
Sometimes I find myself working backwards up a tree of errors to fix a problem. Today was a case in point.
Since I’ve been doing a bit of WordPress grooming, I have the development build checked out locally. Previously I had run phpunit against the unit tests included in the code, but for some reason when I tried to run things under NetBeans, it would error out (Bug 247704).
If you read my previous post (WordPress Recovery), you know I’ve been writing some code to recover my old posts. It occurred to me I could take a small segment of what I’ve been doing with that code to demonstrate my approach to TDD.
Since I’m a hacker from way back, and also because I was in semi-panic mode about losing the content, I didn’t approach this task with testing in mind. Now that doesn’t always result in bad code: I’ve been doing this long enough that I can usually think through a fairly good model and code something that isn’t one long method full of inline code.
In this case however, once I had started coding, I realized again that this was an opportunity to practice coding the “right” way. I had already begun with a Maven project, and generated unit tests as I went through the process of starting to build the code, so I had at least some good functioning unit tests.
So when I finally got my blog set up to host the few static pages I had, I just changed the directory on my server to have a symbolic link to the directory where wordpress.accuweaver.com had it’s content:
Removed the directory httpdocs from /var/www/vhosts/accuweaver.com
Added a link in that folder to /var/www/vhosts/accuweaver.com/subdomains/wordpress/httpdocs.
This actually worked really well, since the content was only in one place, and all I had to do was change the host name in WordPress. Continue reading →
I decided I’d walk through creating a new app to replace one I’ve used for years on my iPhone that no longer appears to be maintained. The app in question is called GasBag which as near as I can tell stopped being updated in 2009 (see: http://blog.jam-code.com/).
I could just write a quick and dirty web app to store my mileage, but I figured I’d approach this as an exercise in building an iOS application with a design first approach.
At a high level, what I want is an app that easily captures my mileage, and allows me to save that information somewhere that won’t get destroyed. There are a number of features that GasBag had that I liked (for instance being able to send an email with my mileage information), and a number that it doesn’t have that would be nice (like allowing me to use it for multiple cars, or to do some data capture from a gas station receipt).
One of the moves I made in my first year with them was to migrate our event calendar to Eventbrite and Meetup. One of the gaps I found with Eventbrite is that it doesn’t have a way to provide a feed of events that can be used to update an external calendar, so I embarked on a little programming effort to create one.
Most calendar programs allow you to pull external events using the iCalendar (ics) format, and Eventbrite actually has a pretty decent API to allow you to pull the events, so I decided to write a simple PHP script to allow me generate an iCalendar feed.
Looking at the code, you can see it’s pretty basic, just a few PHP classes, some unit tests, Netbeans project and data.
Once the code was working, I used the iCalendar validator at http://severinghaus.org/projects/icv/ to make sure the results are good, and (at least for PMI-SFBAC) they are.
Eventually this results in a URL that I used as a feed into the All-in-One Calendar from Time.ly which lets me show events on my site’s calendar along with any other iCalendar feeds I choose to add.
To configure the All-in-One calendar, I just go to the Events in the WordPress admin panel, and add the feed.
After I add the feed I click the “Refresh” button to make sure the events show up on my calendar immediately. The events then get updated on a periodic basis (daily by default), and should keep you up to date.
Another use I put this feed to is to add the Eventbrite calendar to my Google Calendar. I have a calendar feed from Meetup, and several of my friends so that I can quickly see what is going on that day.
The same basic idea for Google Calendar: you go to your Google Calendar, click the drop down on “Other Calendars” and choose “Add by URL”.
This gives you a nice view of events so that when you are scheduling things you can see what’s coming up that you might be interested in.