WCF Validation

The great thing about writing code is that you are almost assured that whatever you think would “be cool” someone out there in the world has written already. For example, I wanted to use DataAnnotations on my WCF model for validation. Silly me, I thought it would just work. I mean, it makes sense, right? Well, while it doesn’t work out of the box, it is something that makes sense, so someone wrote the code already!

I found this post over at DevTrends. It explains the logic behind using DataAnnotations for validation. My favorite part:

So a fantastic validation framework is available with .NET. All we need to do is integrate it into WCF.

Really, I am surprised this isn’t part of the framework, but whatever. Paul created a NuGet package, and that makes it so easy that it may as well be part of the framework. Thanks, Paul!
🙂

WebAPI and JSON Serialization

I was getting this crazy “k__BackingField” crap, and quickly found this pablissimo.com post. It links to a post about changing the JSON serializer. Unfortunately, JSON.net is already used, so I am not sure why I was getting the crazy JSON garbage. [DataContract] and [DataMember] did the trick, but I am still left wondering why I had to go here? Oh well, I guess it is better to be explicit anyway, right?

On a semi-related note, I found this post on JSON casing with JsonMediaTypeFormatter. Pretty cool stuff…

Bootstrap Add-Ons

There is a great, big list of badass for Bootstrap over at bootstraphero.

Some of my favories:

I’ll also be checking out those WordPress themes…

Select2 and Chosen

I was looking at my options for including an image in a select list – why is this not easier?

Anyway, I found some good Stackoverflow Q & A’s, and one mentions Select2. This is a pretty slicklooking jQuery extension, and it is based on another really cool plugin, Chosen.

The Select2 site uses Bootstrap, and the more I see examples in Bootstrap the more I <3 Bootstrap! I have discussed moving our company site over to Bootstrap to take advantage of the goodness that it offers (especially responsive UI) and the Select2 would be a great addition.

So much to do and so little time… 🙂

Powershell Cookbook

I have been working on a LOT of automation scripting, and for whatever reason whenever I did this int he past I always used batch files – I guess I was just used to it? Whatever…

I got smart (finally) and started using Powershell and I have been able to do some pretty cool automation (post with scripts incoming). Powershell has a quirky syntax, and I have been doing lots of googling. I just ran across the Powershell Cookbook. Pretty good stuff…

What a PITA!

frustration300x300

I got the seemingly ever-present message to upgrade WP, so I stupidly did. Then I could no longer log in!?! It kept saying my password was incorrect. I could not send myself a password reset because the mail server isn’t configured. Great.

After much searching and a lot of wasted time, I finally was able to manually change my password. The following pages came in very handy:

The MySQL Workbench tools were also invaluable, as it was much easier to download/install than to setup phpMyAdmin.

I am really hoping that this was in fact related to the install. I’d hate to think that somehow my blog login was compromised. It seems a bit too coincidental though, so it most likely was something upgrade-related. I’ll have to check out my other accounts though…

Lorem Pixel

LoremPixel.comClick the refresh icon to update the sample image
refresh-icon16x16

LoremPixel.com – the Lorem Ipsum of images.

This, lorem ipsum and Twitter Bootstrap and you can whip up a pretty good mockup/prototype.

Instruction for use, taken directly from the lorem pixel homepage:

Placeholder Images for every case. Webdesign or Print. It’s simple and absolutely free! Just put the custom url in your code like this:
<img src="http://lorempixel.com/400/200" />
to get your FPO / dummy image.

http://lorempixel.com/400/200 to get a random picture of 400 x 200 pixels
http://lorempixel.com/g/400/200 to get a random gray picture of 400 x 200 pixels
http://lorempixel.com/400/200/sports to get a random picture of the sports category
http://lorempixel.com/400/200/sports/1 to get picture no. 1/10 from the sports category
http://lorempixel.com/400/200/sports/Dummy-Text …with a custom text on the random Picture
http://lorempixel.com/400/200/sports/1/Dummy-Text …with a custom text on the selected Picture

Twitter Bootstrap and Font Awesome

http://www.flickr.com/photos/blentley/5387467938/in/photostream/

http://www.flickr.com/photos/blentley/5387467938/in/photostream/

I started my little “todo” list in backbone (it is a rule that you have to create a todo list for your initial foray into backbone, apparently) and I decided to use Twitter Bootstrap. I like that it has a nice, clean look, but I also don’t like that I see it used in every example. Pretty soon every site on the net will look the same, and I don’t necessarily think that is a good thing…

I wanted to add a “delete” icon, and it was really simple. however, I think that a delete icon should be red. Unfortunately bootstrap doesn’t work this way. I did a quick google and found a post on StackOverflow about using bootstrap and colored icons. The marked answer mentions Font Awesome.

Font Awesome is… well, awesome! It uses @font-face so you can use CSS to style the icons. Ima ’bout to get on that right now…