Git Credentials Helper

While working with git and GitHub it can often become annoying to always have to type in credentials when dealing with remote repositories. Thankfully GitHub has suggestions for Mac, Windows and Linux. For those of you who don’t care for the link, heres a summary: Mac: There’s more than one step involved: Check if osxkeychain is setup: git credential-osxkeychain git config credential.helper osxkeychain Windows: git config credential.helper wincred Linux (and actually for all of them if you prefer a generic way): git config credential.helper cache All of the above will set up the credentials for the specific git directory you are working on. If you would Continue reading Git Credentials Helper

Obligatory Unit Testing Post

Any developer worth his salt well tell you that unit testing is sweet. In fact unit tested code will simply help you sleep better, it’s that good. Sometimes, though, its easy to get bogged down in a project’s deadlines and skip the testing altogether. To avoid this I try to use tools that make the testing portion as easy as possible. Two of the best tools that I’ve found for .NET unit testing are XUnit and Moq, both available through nuget. XUnit and Moq are a powerful combination. XUnit is, in my opinion, the friendliest testing framework for .NET (for Continue reading Obligatory Unit Testing Post

Creating a Safer Guid

Guids (Globally Unique Identifers) are great. They are very useful when uniqueness is important, maybe for identification later on. They are fairly efficient to create and are even human readable. So yeah, Guids are pretty great… except when they aren’t. A common use case for a Guid (for me at least) is to receive it as a set of characters and then convert it to an actual Guid (in C#). This usually looks like this: public void CallWithGuidAsString(string guid) { Guid newGuid = new Guid(guid); // Do stuff with guid. } The issue with this is that it is not Continue reading Creating a Safer Guid

MongoDB from D to B

Hello again reader! (I hope there’s at least one of you) It’s been quite a while since I wrote last and to be honest for a while it looked like I might never write again. It certainly wasn’t because I didn’t think about writing, in fact, I thought about writing almost every week. However, between adapting to ‘Agile‘ development at work and keeping up with my courses I didn’t even have time to blink. As of today, though, I’m putting this ship back on track so I will move on to the actual topic… This post is kind of a Continue reading MongoDB from D to B

Simple C# XML Schema Validation

While working I’ve often had to deal with data being sent in XML. Specifically, working on web services which are constantly passing it around. This data usually needs to be marshaled into some domain objects to continue working, but sometimes the data being sent is no good. One solution I found to fail early when encountering bad XML was validating it against it’s schema. I’m not sure if there are simpler ways, but this is how I was able to do it in C#: public string IsValidXml(string xmlString, string schemaPath) { if (string.IsNullOrWhiteSpace(xmlString)) { throw new ArgumentNullException(“xmlString”); } if (string.IsNullOrWhiteSpace(schemaPath)) { Continue reading Simple C# XML Schema Validation

MongoDB Replica Set Windows Service

I have been doing some development using MongoDB lately, and I have been very happy with it. One of the things I had to do was set it up as a Windows service in the development servers where I work. The process was relatively simple, but seems like a great bit of information to document. I will be showing the settings I use, which include creating the mongo instances as part of a replica set and exposing a RESTful service for monitoring. The following can be done from either the standard Windows command line or PowerShell. I assume you are somewhat familiar with Continue reading MongoDB Replica Set Windows Service

WordPress: 1and1 Click & Destroy

When I first started this endeavor I was swayed by the simplicity of 1and1’s (my host) touted ‘Click & Build’ feature. I was so swayed by it that I made the mistake of first attempting to set up WordPress like that. What I got was a husk of WordPress, an outdated, impossible to update or fully customize version. After removing this version with 1and1’s much more useful feature, the one click uninstall, I set about to set up WordPress on my own. As it turns out this is not a difficult task at all. The following guide should show anyone Continue reading WordPress: 1and1 Click & Destroy

Hello Blog?

Just getting the first taste of what a blog post feels like. In the future you may look forward to some actual information in these pages. I’m currently working heavily in .NET development and edging out towards other technologies. Specifically I’m dealing with things like WCF, Unity, and MongoDB. Look out for posts covering my troubles  and successes with those soon. I’ll come back around another day… with some content.