Posts on Development

  1. Change default shell for OpenSSH on Windows

    If you are using OpenSSH on Windows the default shell used when connecting is cmd.exe. To update Windows to use something different you need to update the registry and restart the OpenSSH service.

  2. Changing the commit author

    So, you made some commits and then realise you used the wrong author and email address. No problem, use the following command to update them all and then you can push with consistent happiness.

  3. Auto Update Git Aliases

    Because I am lazy I wrote a script so I can update all my machines from the one location which is the gist below. This works in powershell core. Again this is mostly for me but feel free to use as needed.

  4. Using PowerShell core in Visual Studio Code on windows

    This is more for me than anyone else. If you want to move to PowerShell core in Visual Studio Code then do the following.

    1. Press CTRL + , to open settings.
    2. Enter Shell: Windows in the search box.
    3. Scroll down to Terminal > Integrated > Shell: Windows
    4. Click on ‘Edit in settings.json’ and add the following.

    code snippet start

  5. Using git aliases

    I work with git for home and work project, I recently found you can use alias across all platforms due to the way it runs on windows. So all these aliases will work happily on git for windows and hopefully will make you work day more streamlined.

    Some are from sites I have found and other I have created myself.

  6. WPF Converter: CaseConverter

    Case Converter was made when I wanted the text to display in a WPF UI in upper case. Probably not the best class name, but anyway. To get the code and install read on. Make any UI string uppercase. Once you have registered the resource and created the class just use the converter in the element you want converted.

  7. Why Procmon is a great tool!

    Procmon is created by sysinternals and should be deployed to any server in your enterprise (and desktop) it allows you to see what file, registry, network and processed & thread activity is happening on your system. I just used to to work out why VS 2010 was not installing, it turns out it iterates through all the drives on your system including your mapped drives. As I had just been playing with WebDav I had a mapped WebDav drive which was very slow to access. Looking at proc mon I could see straight away what the issue was and I disconnected the drive. Problem sovled!

  8. Why Procmon is a great tool!

    Procmon is created by sysinternals and should be deployed to any server in your enterprise (and desktop) it allows you to see what file, registry, network and processed & thread activity is happening on your system. I just used to to work out why VS 2010 was not installing, it turns out it iterates through all the drives on your system including your mapped drives. As I had just been playing with WebDav I had a mapped WebDav drive which was very slow to access. Looking at proc mon I could see straight away what the issue was and I disconnected the drive. Problem sovled!

  9. Getting a Outlook MailItem from a Ribbon Event

    You may find this code block handy: [csharp] /// /// Gets the mail item selected in the explorer view if one is selected or instance if that is the view active. /// /// The instance containing the event data. /// A Outlook.MailItem for the mail being viewed. private Outlook.MailItem GetMailItem(RibbonControlEventArgs e) { // Check to see if a item is select in explorer or we are in inspector. if (e.Control.Context is Outlook.Inspector) { Outlook.Inspector inspector = (Outlook.Inspector)e.Control.Context; if (inspector.CurrentItem is Outlook.MailItem) { return inspector.CurrentItem as Outlook.MailItem; } } if (e.Control.Context is Outlook.Explorer) { Outlook.Explorer explorer = (Outlook.Explorer)e.Control.Context; Outlook.Selection selectedItems = explorer.Selection; if (selectedItems.Count != 1) { return null; } if (selectedItems[1] is Outlook.MailItem) { return selectedItems[1] as Outlook.MailItem; } } return null; } [/csharp]

  10. Visual Command Prompt Here

    If you want to have the Visual Studio command prompt on the right-click on the folder place the below into a text file with a .reg extension and then add it to the registry.