View broken-wsl.cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lxrun /uninstall /full` | |
lxrun /install` |
View 1-linq-list-to-dictionary.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var result = List.Select((x, i) => new { Key = i, Value = x }).ToDictionary(x => x.Key, x => x.Value); |
View wpf-page-in-frame.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Frame> | |
<Frame.Content> | |
<Page/> | |
</Frame.Content> | |
</Frame> |
View wpf-system-net-sockets-error.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<PropertyGroup> | |
<RestoreProjectStyle>PackageReference</RestoreProjectStyle> | |
</PropertyGroup> |
View removing-characters-forbidden-in-windows-filenames.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Regex illegalInFileName = new Regex(@"[\\/:*?""<>|]"); | |
string myString = illegalInFileName.Replace(myString, ""); |
View mynaturewatchcamera-download-all.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scp –r pi@mynaturewatchcamera:/home/pi/NaturewatchCameraServer/naturewatch_camera_server/static/data ~/Desktop/data |
View PowerShellInvoke.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string directory = ""; // directory of the git repository | |
using (PowerShell powershell = PowerShell.Create()) { | |
// this changes from the user folder that PowerShell starts up with to your git repository | |
powershell.AddScript($"cd {directory}"); | |
powershell.AddScript(@"git init"); | |
powershell.AddScript(@"git add *"); | |
powershell.AddScript(@"git commit -m 'git commit from PowerShell in C#'"); | |
powershell.AddScript(@"git push"); |
View App.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Application x:Class="WpfTrayIcon.App" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
ShutdownMode="OnExplicitShutdown" | |
> | |
<Application.Resources> | |
</Application.Resources> | |
</Application> |
View md5hash.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$md5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider | |
$utf8 = New-Object -TypeName System.Text.UTF8Encoding | |
$String = "Hello, world!" | |
$Hash = ([System.BitConverter]::ToString($md5.ComputeHash($utf8.GetBytes($String)))).replace("-","").ToLower() |
NewerOlder