Friday, May 11, 2012

Don’t Forget to Secure your TypeKit!

Today I made a stupid mistake. I am using TypeKit and I added my reference like so:

<script type="text/javascript" src="http://use.typekit.com/….js"></script>

Can you see what’s wrong?

It works great in local development, however when I deploy to production, I will be using HTTPS. When my page tries to hit the TypeKit servers over HTTP, my browser is going to complain about insecure connections.

I could switch to

<script type="text/javascript" src="https://use.typekit.com/….js"></script>

but instead I decided to make my link protocol relative:

<script type="text/javascript" src="//use.typekit.com/….js"></script

this way it will call the protocol that my site is currently serving. TypeKit does support HTTPS.

Tuesday, May 8, 2012

Don’t be a Richard, or How to Manage App Store Releases

As a software developer, I understand the desire to get paid for your work. I was one of the few people who didn’t whine when RedGate decided to charge for .NET Reflector. Their change in plans didn’t affect their currently released software, only future releases. So if you were happy with what you had, you could go on in blissful happiness.

The nature of “App Store” releases makes the decision to go from free (or freemium) to paid more complicated. If you update your app, I can decide not to install the update, but I then have to be very careful on how I manage my device. I can’t go back and install previous versions. So if you update your app to take what was once free and require an in-app purchase to unlock it, you are being a Richard.

You want to make the software better, great. You want to get paid for your hard work, great. But don’t alienate me in the process. A better experience would be to release your updated version as a brand new app, end-of-life the existing app with one last update to notify users that the version is no longer supported and link to the new app. Existing users who are happy with what they have are happy. Nerds like me who have to have the latest and greatest install the new app and are happy. You get paid and are happy. Everyone wins.

Here’s my $1.99 for my that feature you removed, Richard.

Wednesday, April 25, 2012

Access IISExpress from Remote Machine

Today I tried to access my development site from a VM and was unable to connect. Thanks to @vcsjones, I learned that you can edit My Documents > IISExpress > config > applicationhost.config. Look for the sites section:

        <sites>
            <site name="MyApplication" id="0">
                <bindings>
                    <binding protocol="http" bindingInformation="*:2600:localhost" />
                </bindings>
            </site>
        </sites>
duplicate the localhost line and replace “localhost” with the hostname you want to allow.
Thanks Dr. Jones.

Wednesday, April 18, 2012

Testing the Order of Your Collections

I was trying to test that a service call was returning my data in order. I didn’t want to implement an IComparer to pass into CollectionAssert.IsOrdered(). Thanks to some insight from Ahmad on StackOverflow I was able to come up with the following assert:

Assert.That(result, Is.Ordered.By("Name"));
Simple!

Monday, March 12, 2012

“Natural” Scrolling with Logitech Touchpad

I love my new Logitech Touchpad. It makes my work PC experience one step closer to my home Apple development environment. The one annoyance has been that the Touchpad options do not include an option for inverting the scrolling to allow for the “natural” scrolling like that on the Mac since Lion. (If you haven’t tried natural scrolling, it take a few days to get used to but makes so much more sense in a touch world. Do you scroll down your phone browser page by swiping your finger up or down? Shouldn’t your touchpad have the same movement?)

I found a nice little script for AutoHotKey here. It works great and I’m much happier.

Tuesday, March 6, 2012

Detecting Element Visibility in WatiN

I recently needed to check the visibility of an element in a WatiN test and I came across a very helpful post by Ashley Tate. I turned his method into the following extension method which makes my tests nice and easy.

   1:  public static class ElementExtensions
   2:  {
   3:      public static bool IsDisplayed(this Element element)
   4:      {
   5:          if (string.Equals(element.Style.Display, "none"))
   6:          {
   7:              return false;
   8:          }
   9:          return element.Parent == null || element.Parent.IsDisplayed();
  10:      }
  11:  }