Tuesday, January 08, 2013

Load LinkedIn API asynchronously


  1. Use the async version of the API
    http://platform.linkedin.com/in.js?async=true
  2. Load the library asynchronously
    <script type="text/javascript">
    (function()
    {
    var e = document.createElement('script');
    e.type = 'text/javascript';
    e.async = false;
    e.src = 'http://platform.linkedin.com/in.js?async=true';
    e.onload = function(){IN.init() };
    var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(e, s);
    })();
    </script>
You may provide additional parameters like  "onLoad" -callback function & APIKey
in the call to IN.init({Param1:Value1, Param2:Value2})

Friday, January 04, 2013

"ReadKey Exception" trying to pause PowerShell Script

If you use $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") to pause in a PowerShell script, you get the following error message:
Exception calling "ReadKey" with "1" argument(s): "The method or operation is not implemented."

Reason: You are probably running the PowerShell script in the PowerShell ISE thus the related IO sub-system is unavailable.

Solution: Run the script directly and not from the PowerShell - ISE, it will work as expected.