/* BeejBlog */

Minimal pure CSS Treeview with FontAwesome expanders

Update 2015-07-18: shux! not valid to apply ::before/after psuedo elements to <input> since it's not technically content (stack-o reference)

jQuery replacement:




Works in Chrome and Safari but not Firefox or IE :(

Look ma, no JavaScript! :)

Leveraging (hidden) checkbox element to maintain expand/collapse state and
:before {content: "xyz" }
 css to avoid extra elements.
Not an original idea but wanted to see of i could trim down all the extra html markup & css required.
Turned out swell! The <input> is the only additional overhead above standard markup, sahweet!

External Content in Blogger Post

Highlights:
  • pull content from 3rd party source, using crossorigin.me (CORS proxy) to avoid "no 'access-control-allow-origin' header is present on the requested resource"
  • from what i can glean, Blogger does not offer any kind of server side include facility so we have to resort to client browser tricks and that means this content is NOT going to be crawled/googlable
  • this approach relies on jQuery (Core) so you'll need to have that referenced as well - example here, but also make sure you point at the latest version

Usage:
drop this helper function in a global JS/HTML widget via the Blogger Layout editor...
function pluginContent(url, containerSelector, boolPrettyPrint) {
  var ctrl = $(containerSelector);
  $.get("http://crossorigin.me/"+url)
    .done(function (result) {
        ctrl.html(result);

        //force prettyPrint rendering after loading dynamic content
        // google on: "google code prettify" to get dialed in on this code syntax highlighting library
        // => https://code.google.com/p/google-code-prettify/wiki/GettingStarted
        if (boolPrettyPrint) {
          ctrl.removeClass("prettyprinted");
          PR.prettyPrint();
        }
    })
    .fail(function() {
      ctrl.html('failed to retrieve external content.<\br>'+
        'try going there directly: <a href="'+url+'">'+url+'</a>')
    });
}

Then use it like this in an individual blogpost:
<pre class="prettyprint linenums lang-powershell" id="prePoshDualExplorers"></pre>

<script>
  //pull code content from codeplex
  pluginContent("https://beejpowershell.svn.codeplex.com/svn/PoshDualExplorers/PoshDualExplorers.ps1", "#prePoshDualExplorers", true);
</script>

PowerShell Dual Windows Explorers

Nutshell: Hosting two Windows File Explorers inside a WinForm... with the potential of sprinkling some utility hotkeys on top - e.g. "copy from left to right".

Full source on GitHub

Highlights:
  • Always wanted to try this and just finally got around to it... and it actually works to a decent degree.
  • This is of course well covered ground with various other file managers... i just wanted to see if you could do it this poor man's way with PowerShell driving... so one could readily make it one's own with further customizations
  • I was a longtime fan of Directly Opus... I think it's significant that this meager alternative is customized via standard PowerShell vs a 3rd party scripting environment that must be learned... i.e. if you happen to already know PowerShell, you can jump right in with all that file handling power available
  • The obnoxious part is hunting down the COM interfaces necessary to pull stuff out of FileExplorer... it dips into silliness like how IE is somehow part of the equation.
  • See comments for all the good posts i drew from to cobble it together... lots of handy Shell programming nuggets to be had
  • thanks to a handy github project, Font-Awesome is now in the WinForms domain - too cool
  • notes to self
    • interop.SHDocVw.dll is generated from doing a Visual Studio reference to C:\windows\system32\shdocvmw.dll
    • interop.Shell32.dll seemed like it was going to come in handy but didn't wind up being necessary
    • these are the only real FileExplorer API calls necessary for the CopyFile piece
      • $objFolder = $objShell.NameSpace($explorerRight_SHDocVw.LocationUrl)
      • $objFolder.CopyHere($explorerLeft_SHDocVw.Document.SelectedItems())
    • there are a few wacky interfaces behind the shell objects but the neat thing is that runtime dynamic type binding makes using real types largely irrelevant... i feel that does lose some self documentation in the balance so i've tried to include the pertinent interfaces in the comments for future reference and expansion