<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="http://jamessouth.me/blog/rss/xslt"?>
<rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>James Jackson-South</title>
    <link>http://jamessouth.me/blog/</link>
    <description>Microsoft MVP, Creator of ImageSharp, ImageProcessor and ResponsiveBP, Web developer, Lifter of heavy weights, and all round nice guy.</description>
    <generator>Articulate, blogging built on Umbraco</generator>
    <item>
      <guid isPermaLink="false">1130</guid>
      <link>http://jamessouth.me/archive/wrangling-the-microsoft-mvp-activity-bookmarklet/</link>
      <category>System.String[]</category>
      <title>Wrangling The Microsoft MVP Activity Bookmarklet</title>
      <description>&lt;p&gt;I'm lucky enough to be a Microsoft MVP in Visual Studio and Development Technologies which is absolutely fantastic. I've been having trouble submitting my work though in an efficient manner so I thought I'd put this short post together to show how I got the MVP Submit Activity Bookmarklet to bend to my will in Microsoft Edge so I can help others in a similar situation.&lt;/p&gt;
&lt;h2&gt;The Problem&lt;/h2&gt;
&lt;p&gt;The &amp;quot;Submit Activity&amp;quot; interface in the MVP website is not great. It's clunky, slow, requires a lot of fields, and requires a lot of tab switching. I find it off-putting to use which means I don't fill it in when I should. Fortunately Microsoft offered an alternative approach.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://jamessouth.me/blog/media/1051/mvp-bookmark.jpg?width=1000" alt="Introducing MVP Bookmarlet Tool" /&gt;&lt;/p&gt;
&lt;p&gt;All is good. Except that it isn't. There's a couple of issues.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The bookmarklet is fundamentally broken, expecting a relative path in it's code. This means it doesn't work on any page other than within the MVP site!&lt;/li&gt;
&lt;li&gt;When fixed, that bookmarklet doesn't work in Chrome asking you to sign in when you already are.&lt;/li&gt;
&lt;li&gt;Microsoft Edge doesn't support adding bookmarklets through it's interface.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Fortunately we can fix this.&lt;/p&gt;
&lt;h2&gt;The Solution&lt;/h2&gt;
&lt;h3&gt;Fixing the Source&lt;/h3&gt;
&lt;p&gt;First we need to fix the JavaScript snippet so that it actually works.&lt;/p&gt;
&lt;p&gt;Here's the original code.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;javascript: (function () {
    if (window.myBookmarklet !== undefined) {
        myBookmarklet();
    } else {
        document.body.appendChild(document.createElement('script')).src = '/Content/Scripts/bookmarklet.js?';
    }
})();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;See the issue? Yeah that relative src path is never gonna work! &lt;/p&gt;
&lt;p&gt;So knowing the correct URL (Since we know that it works within the MVP site) let's update that.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;javascript: (function () {
    if (window.myBookmarklet !== undefined) {
        myBookmarklet();
    } else {
        document.body.appendChild(document.createElement('script')).src = 'https://mvp.microsoft.com/Content/Scripts/bookmarklet.js?';
    }
})();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Ok we have fixed the source code but that's only half of the solution. When we try to use the updated bookmarklet code in Chrome (A browser that natively supports bookmarklets) we are greeted with this.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://jamessouth.me/blog/media/1052/mvp-sign-in.jpg?width=1000" alt="MVP Sign in model" /&gt;&lt;/p&gt;
&lt;p&gt;But I'm already signed in! Let's give Edge a try since it's Microsoft product and they always work together right.... Right?&lt;/p&gt;
&lt;p&gt;Wrong! As discussed before Microsoft Edge doesn't natively support bookmarklets to we are going to turn to a 3rd paty tool to help us out. &lt;strong&gt;Edge Management&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;Edge Management To The Rescue!&lt;/h3&gt;
&lt;p&gt;&lt;a href="http://www.emmet-gray.com/Articles/EdgeManage.html"&gt;Edge Management&lt;/a&gt; is a handy little tool written by a gentleman called &lt;a href="http://www.emmet-gray.com/AboutMe.html"&gt;Emmet Gray&lt;/a&gt; that allows you to manage your Favourites in a manner more consistent with other browsers. We'll use that to add a working bookmarklet.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;First you need to create a standard bookmark. Add any page to your Favourites Bar naming it &amp;quot;Submit MVP Activity&amp;quot;. &lt;/li&gt;
&lt;li&gt;Then close Edge and open the Edge Management tool. Edit the URL with our updates code snippet. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="http://jamessouth.me/blog/media/1053/mvp-edge.jpg?width=1000" alt="Edge Management interface" /&gt;&lt;/p&gt;
&lt;p&gt;That should have done the trick. Let's test it.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://jamessouth.me/blog/media/1054/mvp-form.jpg?width=1000" alt="MVP Submit Activity Modal" /&gt;&lt;/p&gt;
&lt;p&gt;Voilà! It works... Now I can submit my work in a much more convenient manner and get back to the business of writing great code. (I've got a &lt;a href="https://github.com/JimBobSquarePants/ImageSharp"&gt;2D graphics library&lt;/a&gt; to ship!)&lt;/p&gt;
&lt;p&gt;Thanks for reading. I hope that you find it useful!&lt;/p&gt;
&lt;p&gt;P.S If anyone who is on the team responsible for the MVP website is reading this please create a proper fix, or even better make the entire process less painful. The MVP website user interface is really quite annoying to use. &lt;/p&gt;
</description>
      <pubDate>Sun, 05 Feb 2017 18:57:26 Z</pubDate>
      <a10:updated>2017-02-05T18:57:26Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1111</guid>
      <link>http://jamessouth.me/archive/filepath-too-long/</link>
      <category>System.String[]</category>
      <title>Filepath too long?</title>
      <description>&lt;p&gt;I thought I'd write this post as a reminder to myself and as a helper for anyone daft enough to try to use Node on a Windows machine.&lt;/p&gt;
&lt;p&gt;Node has a mental system for managing packages which involves deeply nesting dependencies in the &lt;code&gt;node_modules&lt;/code&gt; folder. This can lead to all sorts of problems on Windows machines like making the &lt;code&gt;--watch&lt;/code&gt; overload for Jekyll die on its ass.&lt;/p&gt;
&lt;p&gt;You can't even delete the damn thing properly due to Windows path constraints. It's really annoying to say the least but at least they know about &lt;a href="https://github.com/npm/npm/issues/3697"&gt;it&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here's a quick method I use to remove the folder when I need to.&lt;/p&gt;
&lt;p&gt;Open a command prompt or whatever your shell tool of choice is, navigate to the parent folder of the &lt;code&gt;node_modules&lt;/code&gt; folder and type in the following commands:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mkdir foo
robocopy foo node_modules /MIR
del foo
del node_modules
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This command uses the &lt;a href="http://technet.microsoft.com/en-us/library/cc733145.aspx"&gt;robocopy utility&lt;/a&gt; and the /MIR &amp;quot;mirror&amp;quot; flag to mirror the empty &lt;code&gt;foo&lt;/code&gt;  directory to the &lt;code&gt;node_modules&lt;/code&gt; folder emptying it out. You can then delete both directories.&lt;/p&gt;
&lt;p&gt;Voilà :)&lt;/p&gt;
</description>
      <pubDate>Tue, 05 Aug 2014 13:57:28 Z</pubDate>
      <a10:updated>2014-08-05T13:57:28Z</a10:updated>
    </item>
  </channel>
</rss>