/* BeejBløg */

Nov 22, 2016 - 1 minute read - Comments -


#r “Interop.IWshRuntimeLibrary.dll” //generated by referencing "Windows Script Host Object Model" in Visual Studio project //from here: https://stackoverflow.com/a/4909475/813599 using IWshRuntimeLibrary; using System.Text.RegularExpressions; var wsh = new WshShell(); var shortcutFileNames = System.IO.Directory.EnumerateFiles(Env.ScriptArgs[0], "*.lnk"); var wshShortcuts = new Dictionary<String, IWshShortcut>(); foreach (var shortcutFileName in shortcutFileNames) wshShortcuts[Regex.Match(shortcutFileName, ".*?- (.*?).lnk").Groups[1].Value] = (IWshShortcut)wsh.CreateShortcut(shortcutFileName); //var maxFileNameLength = wshShortcuts.Max(kv=>kv.Key.Length); Console.WriteLine("Display Name | Target | Arguments"); Console.WriteLine("--- | --- | ---"); foreach(var sc in wshShortcuts) Console.WriteLine($"{sc.Key} | {sc.Value.TargetPath} | {sc.

Nov 22, 2016 - 1 minute read - Comments -

Launch .CSX as conveniently as .BAT files

first, get Chocolatety if you don’t already have… killer handy @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" then make sure you have a .csx runner… either ScriptCS or csi.exe starting with Visual Studio 2015 update 3 choco install ScriptCS setup the .csx to runner file association assoc .csx=CSharpScript ftype csharpscript=C:\ProgramData\chocolatey\bin\scriptcs.exe %1 -- %~2 %~2 means all args starting with #2… see ftype docs for more

Nov 22, 2016 - 1 minute read - Comments -

Solving Visual Studio 2017 -> Xamarin Mac Agent connectivity issues

this seems to be a recurring theme for me so i expect to be throwing more bones on this pile as the sands of time leave behind our lives sublime Xamarin Forums Post i had VS2017 doing iOS builds just yesterday but for some reason was getting persist Mac Agent “can’t connect” errors today… and zilch in the xam logs to go on, yikes… thankfully struck me to look at Mac “Console” system.

Nov 21, 2016 - 1 minute read - Comments -

Recurring Windows 10 Tweaks

once and for all 🙂 Shortcuts for “Pin To Start” %appdata%\Microsoft\Windows\Start Menu Start Menu right mouse (aka “Win+X” menu) install Win+X Menu Editor my faves: Name Target Win+X Menu Editor C:\Users\beej1\Beej\bin\Win+X Menu Editor v2.7.0.0\WinXEditor.exe Command Prompt C:\Program Files\ConEmu\ConEmu64.exe Windows PowerShell powershell.exe Edit Environment Variables rundll32.exe sysdm.cpl,EditEnvironmentVariables Uninstall Programs appwiz.cpl Windows Features OptionalFeatures.exe Services services.

Nov 2, 2016 - 2 minute read - Comments -

“Hot Corners” for Windows (PowerShell)

GitHub files PoShHotCorners “Hot Corners” for Windows install none really, simply download the ico and ps1 files to a folder and launch the ps1 please note MakeShortcut.cmd batch file provided for convenience … throw resulting .lnk file in your “run on startup” folder if you like: "%appdata%\Microsoft\Windows\Start Menu\Programs\Startup" as you can see, the batch file simply runs shortcut tool xxmklink.exe with appropriate arguments notes currently coded to power down monitors triggered by mouse in lower right corner … but it’s just powershell folks, so think grand!

Oct 28, 2016 - 1 minute read - Comments -

Linq Enumerable to another Collection

given devices is an IEnumberable<> var nvc = devices.Aggregate(new NameValueCollection(), (seed, current) => { seed.Add("device", current.Id.ToString()); return seed; }); Json Array of objects to Dictionary, keyed (indexed) on chosen property using Json.Net; //Newtonsoft using Json.Net.Linq; public class Device { public int Id {get; set;} public string Name {get; set;} public string Property {get; set;} } var json = @"[{id: 1, name: ""name1"", prop: ""prop1""}, {id: 2, name: ""name2"", prop: ""prop""}]"; var devicesDictionary = JArray.

Oct 24, 2016 - 1 minute read - Comments -

PHP SQL Server blob hosting

from here see this post for sql server driver downloads   downloadPDF.php <?php header('Content-type: application/pdf'); // leave this out to open directly in browser: header('Content-Disposition: attachment; filename="my.pdf"'); include("SQLConnect.php"); $sql = "select InvoiceDocument from SalesInvoicePDF where InvoiceID = '123'"; $stmt = sqlsrv_query($conn, $sql); if ( sqlsrv_fetch($stmt) ) { //this pulls the first field via "0" $data = sqlsrv_get_field($stmt, 0, SQLSRV_PHPTYPE_STREAM(SQLSRV_ENC_BINARY)); // write binary sql stream directly to http response fpassthru($data); } ?

Oct 14, 2016 - 2 minute read - Comments -

Lighter Spin on ADAL in Xamarin Forms

tl;dr new-up the elusive “PlatformParameters” in your AppDeligate.cs::FinishedLoading / MainActivity.cs::OnCreate   ts;wm (too short; want more ; ) thankfully we have solid writeups on ADAL with XF… this post is just me trying to boil it down to essence and PCL as much as possible… (BTW: ADAL = Active Directory Auth Lib… i needed it for PowerBI embedding) https://www.appzinside.com/2016/02/22/implement-adal-for-cross-platform-xamarin-applications/ https://blog.xamarin.com/authenticate-mobile-apps-using-microsoft-authentication-library/ the first post keeps the platform specific surface area pretty minimal but also winds up wrappering the stock ADAL classes quite a bit…

Oct 4, 2016 - 2 minute read - Comments -

Toggle XAML <> Code-Behind in Visual Studio 2015, ReSharper, Xamarin Forms

Quickly bouncing between .XAML and corresponding .CS file just seems like an obvious need… i feel like we used to have this in WPF but it’s been a few years for me. Short Story: this approach simply maps preferred hotkey to ReSharper’s “Go To Related Files” command… sorry if that’s not an expense you care to bear but it’s a great tool for numerous reasons if you can spring for it Visual Studio > Tools menu > Options > Environment > Keyboard “Show commands containing” edit box enter: relatedfiles select “ReSharper.

Oct 1, 2016 - 1 minute read - Comments -

Auto Generate PNG’s for Font Awesome icons

… via PowerShell, using ImageMagick v7 motivation comes in handy for Xamarin (Forms) iOS project… season image filenames & sizes to your taste in the CreateFAImages function