Author: nrogoff

HTML emails and getting all you styles in-line with a free online tool

If you have had to put together any html email templates then you know what a pain it is getting things right for all the various email clients out there. especially as Google’s Gmail has a nasty habit of stripping all the CSS goodness from html emails leaving them look not how you intended.

The best advice is to make sure all your styling is inline. This can be a pain to manage if you need to design multiple templates. Thanks to a very neat facility provided by the team at Campaign Monitor you can design your emails using good CSS principle using styles and classes.

When you want to make the final HTML with all your styles in-line, use the free online ‘CSS Inliner’ tool by Campaign Monitor at http://inliner.cm/

HTML Placeholder not working in IE9 and earlier!!

Recently found this very useful jQuery plugin for fixing placeholder issues in old IE browsers. It seems to cover most scenarios and is very easy to  implement 🙂

https://github.com/mathiasbynens/jquery-placeholder

Just add the script after the jQuery and call

$('input, textarea').placeholder();

You will also need to add the placeholder style in your css.

/* Placeholder fix for IE9 for use with jQuery.placeholder plugin */
 .placeholder { color: #aaa; }

If you are a c# razor person, something like this on your impacted pages will do the trick (assuming you something like

@RenderSection("MyJavaScript", false)

in your layout).

@section MyJavaScript
 {
 <script src="@Url.Content("~/Scripts/jquery.placeholder/jquery.placeholder.js")" type="text/javascript"></script>
 <script>
 $('input, textarea').placeholder();
 </script>
 }

How to reset your Remote desktop user account expiry date on your Azure cloud service

If you have not re-deployed your azure cloud service for a while you might just find that your remote access account has expired. Here is a simple way to push out the expiry date without re-deploying.

  1. Login to the Azure Management Console ( https://manage.windowsazure.com ), navigate to you cloud service and select the configure tab
  2. Download the configuration and save to a local temp area.
  3. Open it up in notepad
  4. Find the setting that looks like
    <ns0:Setting name=”Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration” value=”2013-09-07T23:59:59.0000000+01:00″ />
  5. Just change the year to sometime in the future e.g. 2016 and save.
  6. Then from the same configure page in the Azure management console, upload the config file.
  7. Wait a few minutes while the file is process and voila! you can now log in. Of course you must know the original password and usename you used when you last deployed.

How to make a short URL friendly GUID in C#

Been trying my own hack to make a short GUID for a web form submission, but hit issues with incompatible characters. Just before making more changes I came across this excellent blog and code to easily convert GUIDs to Short GUIDs and back.

I have found this especially useful when sending unique vendor transaction refs to the SagePay forms service as they have a 40 character limit.

http://www.singular.co.nz/blog/archive/2007/12/20/shortguid-a-shorter-and-url-friendly-guid-in-c-sharp.aspx

Create a No Hyper-V boot option

There seem to be a number of scenarios where Hyper-V (and it’s many virtual networks and network adapters) can cause problems. My two are running VMware and problems with the Azure emulator with shared cache when debugging in Visual Studio.

To solve this problem you could uninstall the Hyper-V feature, but it’s still important for so many other tasks that this is a real pain.

It is possible to create a simple boot option for Windows 7 and 8 and Windows Server that disables the hypervisor. This is quick and painless, so when you ever need or don’t need Hyper-V, just reboot and select the option you want.

  1. Open a command prompt as Administrator (right-click the start button on the desktop and select ‘Command Prompt (Admin)’
  2. Type
     bcdedit /copy {current} /d "Microsoft Windows 8 - No Hypervisor"

    and press enter.
    This creates a new boot entry identical the the current one.

  3. Type
     bcdedit

    and press enter to list all the boot entries.

  4. Copy the identifier, including curly brackets, for the new boot entry (should be the last in the list)
  5. Now we need to disable the hypervisor on the new entry. Type
     bcdedit /set {the new identifier} hypervisorlaunchtype off

    and press enter.

  6. Now reboot and you will be presented with a nice boot menu option and can choose to boot with or without Hyper-V

Create a Wi-Fi hotspot on your laptop–Windows 8

I wanted to make a hotspot from my unconnected Wi-Fi adapter to allow access to the internet over my  wired Ethernet adapter. Connectify Lite was did not allow me to select my wifi adapter, so gave up and just used the manual method I found described in a very good blog with great instructions here

http://www.nextofwindows.com/how-to-turn-your-windows-8-computer-into-a-wireless-hotspot-access-point/