New Home

It’s taken me a fair amount of time to do this transition. I’ve been switching from LunarPages to DreamHost for a while now. LunarPages just stopped being up to date with all the technologies I needed in order to host all the projects I wanted, but I was (sort of still am) worried about moving from host to another. My primary email is associated with this domain (zacharyc.com). Also, I had a lot of secret hidden files and tools placed around the old website that I had been collecting pretty much since college (when I first started using lunar pages). Yes, that was over 13 years ago.

Lets define the type of technologist I am: I enjoy solving technical problems, but time is limited and there are too many problems for me to be an expert in all of them. I don’t want to be an email expert, but I do want email. I don’t want to be a server administrator but I do want my servers to be secure. So I pay other technologists to worry about those problems so I can worry about the ones I need to worry about. If I spent the time it would take to be an expert in those, I wouldn’t have the time to do all the other things that I want to do.

Looks like DreamHost is doing a pretty good job at meeting my needs. The move was stupid easy. When hosting a new domain on DreamHost, there is a checkbox for them to host Google Suite. All you have to do is check that box, and point the name servers to dream host and the magic works. I keep sending test emails to make sure they are still going through, but so far so good.

Also of note, I’m using a new theme here. I found it when I created a temp backup of my WordPress site on WordPress.com. The theme is called Independent Publisher 2. It’s not easily accessible from the themes download but it is public at GitHub: https://github.com/Automattic/themes/tree/master/independent-publisher-2 and it is working great on installation here. Had to do a couple of tweaks to get it where I wanted to be. I dropped the side bar on the main pages, and moved search to the footer. Other than that, pretty smooth.

Writing a Safari Extension

I’ve switched to using Safari as my primary browser. It works pretty well because I use it on all my devices so passwords and bookmarks are available on all devices.

The one downside, the developer community isn’t as big. We use Github at work for all of our repositories. Github code diffs are constrained by the width of their center column. On larger diffs this can make it hard to see all of the code without tons of scrolling. There is a chrome extension for this task, but there hasn’t been a safari extension for this same task, so I decided to write one.

I have worked on several chrome extensions in the past, so I thought this would be pretty easy, but there are a couple of challenges that I didn’t expect in completing the code. I’d like to share my experience with anyone else starting to write an extension, so hopefully you don’t run through the same issues that I did.

Firstly, you can see the code I used to make the extension here.

This essentially takes something like this:
Narrow Github

and turns it into something like this:

Wide Github

Here are some of my tips for writing a Safari Extensions:

  • If things aren’t working the way you expect, don’t trust the reload. Restart the browser!
  • Even if you just want to do something simple, you need to have a base html page. This page can hit your javascript, but you need to follow the developer instructs.
  • Your HTML page can listen for events and then send actions to your javascript, but you have to listen to all commands and filter out the ones you don’t want.

While I’ve shared my extension with a coworker, I’m pretty sure I”m the only one who uses it. You an download the extension from here.

Comments and suggestions are welcome.

Properties in C#

I’m a new C# programmer. I’m using it for a project at work. Doing an ASP.NET MVC project. So far I’ve been very happy with the language. It has some nice stuff built in. ASP.NET MVC is pretty nice too. It’s almost as easy to use as rails. So, all in all, I’m pretty happy, but today I ran into something stupid.

I have a method that is trying to do a TryUpdateModel(model, new[] {"prop1", "prop2"}); call and my model wasn’t getting updated. I checked out the associated FormCollection and sure enough my values were in it. The problem was in how I was defining my model.

public class MyModel
{
   public int prop1;
   public DateTime prop2;
}

Can you see the problem?

It took some digging, but it turns out that prop1 and prop2 as defined above are not properties. They are public members of the class MyModel. In order to be properties you need to assign them getters and setters like so:

public class MyModel
{
   public int prop1 { get; set; }
   public DateTime prop2 { get; set; }
}

My frustration is that prop1 and prop2 from my perspective as a consumer don’t really change with the new definition. It seems weird I should have to do that. I’m a new C# programmer and I totally believe that in 3 months more of working with this language I might become a purist and understand the reason to have these things behave differently, but for someone new to the language this isn’t the most intuitive approach.

Handspringman.com

For those of you who have known me for more than, say, five years, you know that one of my original web properties was handspringman.com. Unfortunately, due to issues with the way domain registration works, it slipped out of my control. At the time it was prohibitively expensive to reposes (somewhere in the several hundred dollar range).

Well, good news, it’s coming home. I recently checked it’s availability on GoDaddy and was able to procure it relatively inexpensively. I will do my best to put something up there soon.

Modified JustSimple WordPress Theme

I’m not much of a PHP guy, but I chose WordPress for this blog because I feel it is the most stable, well refined, yet easy to use blogging tool out there. Once the platform was decided I started looking for themes that worked well. I finally found something that I really liked when I stumbled on Ciaran Walsh’s blog. The theme is called JustSimple.

It’s a great theme, and I enjoy it on my site, but there areas where it has come up short. Mostly in styles for certain elements. I started a simple github project for my changes to JustSimple Project. One such change I’ve made is to add support for Definition Lists. Terms are bold and definitions are padded left.

If you want, you can download the theme from github (with a shameless use of the definition list):

Zip Format
Zip File
Tar Format
Tar File