This file contains hidden or 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
| Searching for duplicates in '/home/larsw/'... | |
| Unhandled Exception: | |
| System.UnauthorizedAccessException: Access to the path "/home/larsw/.cache/dconf" is denied. | |
| at System.IO.Directory+<EnumerateKind>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0 | |
| at Kodekamp2+getFiles@13.GenerateNext (IEnumerable`1& next) [0x00000] in <filename unknown>:0 | |
| at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[System.String].MoveNextImpl () [0x00000] in <filename unknown>:0 | |
| at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[System.String].System-Collections-IEnumerator-MoveNext () [0x00000] in <filename unknown>:0 | |
| at Kodekamp2+getFiles@13.GenerateNext (IEnumerable`1& next) [0x00000] in <filename unknown>:0 |
This file contains hidden or 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
| module Kodekamp | |
| open System | |
| open System.IO | |
| open System.Security.Cryptography | |
| type Arguments = { ByteCount: int64; Path: string; } | |
| let (|Long|_|) str = | |
| match Int64.TryParse(str) with |
This file contains hidden or 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
| System.UnauthorizedAccessException: Access to the path "/home/larsw/.cache/dconf" is denied. | |
| at System.IO.Directory+<EnumerateKind>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0 | |
| at FSI_0001.Kodekamp+getFiles@22.GenerateNext (IEnumerable`1& next) [0x00000] in <filename unknown>:0 | |
| at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[System.String].MoveNextImpl () [0x00000] in <filename unknown>:0 | |
| at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[System.String].System-Collections-IEnumerator-MoveNext () [0x00000] in <filename unknown>:0 | |
| at FSI_0001.Kodekamp+getFiles@22.GenerateNext (IEnumerable`1& next) [0x00000] in <filename unknown>:0 | |
| at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[System.String].MoveNextImpl () [0x00000] in <filename unknown>:0 | |
| at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[System.String].System-Collections-IEnumerator-MoveNext () [0x00000] in <filename unknown>:0 | |
| at FSI_0001.Kodekamp+getFiles |
This file contains hidden or 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
| let seqGen a b = | |
| seq { | |
| yield! seq { a .. b } | |
| raise (System.UnauthorizedAccessException("foo")) | |
| } | |
| try | |
| seqGen 1 10 | |
| |> Seq.iter (fun x -> printf "%A " x) | |
| with |
This file contains hidden or 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
| // reference xunit | |
| // reference BouncyCastle | |
| // reference Security.Cryptography.dll (CLR Security project @ Codeplex) | |
| public static byte[] ConvertToNCryptEccPrivateBlob(BigInteger d, ECPoint q) | |
| { | |
| // from bcrypt.h: #define BCRYPT_ECDSA_PRIVATE_P384_MAGIC 0x34534345 // ECS4 | |
| var magic = new byte[] { 0x45, 0x43, 0x53, 0x34 }; | |
| var len = new byte[] { 0x30, 0, 0, 0 }; // key length - 384 bit / 8 | |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.DirectoryServices.AccountManagement; | |
| using System.Linq; | |
| using System.Security.Claims; | |
| using System.Threading.Tasks; | |
| using Thinktecture.IdentityServer.Core; | |
| using Thinktecture.IdentityServer.Core.Models; | |
| using Thinktecture.IdentityServer.Core.Services; |
This file contains hidden or 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
| $(function() { | |
| var serilog = $.connection.serilogHub; | |
| serilog.client.sendLogEvent = function(logEvent) { | |
| console.log(logEvent); | |
| } | |
| }); |
This file contains hidden or 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
| npm run dev | |
| > shave@1.0.0 dev /home/larsw/shave | |
| > webpack-dev-server --port 8080 --hot --inline | |
| http://localhost:8080/ | |
| webpack result is served from / | |
| content is served from /home/larsw/shave | |
| [bootstrap-loader]: Hey, we're in DEBUG mode! Yabba dabba doo! |
This file contains hidden or 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
| # Run this from Powershell as Administrator with (New-Object System.Net.WebClient).DownloadString("https://gist.github.com/larsw/fceb8d9b13ddd197c2aa/raw") | powershell -command - | |
| Write-Output "Making Windows 10 more developer workstation oriented..." | |
| Set-ExecutionPolicy Unrestricted | |
| Write-Output "Bloatware removing..." | |
| $apps = @( | |
| "Microsoft.3DBuilder" | |
| "Microsoft.Appconnector" | |
| "Microsoft.BingFinance" | |
| "Microsoft.BingNews" |
This file contains hidden or 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
| l_events_then_should_throw [FAIL] | |
| System.TypeInitializationException : The type initializer for 'System.Data.SqlLocalDb.Logger' threw an exception. | |
| ---- System.TypeInitializationException : The type initializer for 'System.Data.SqlLocalDb.SqlLocalDbConfig' threw | |
| an exception. | |
| -------- System.Runtime.Serialization.SerializationException : Type is not resolved for member 'Serilog.Context.Im | |
| mutableStack`1[[Serilog.Core.ILogEventEnricher, Serilog, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a | |
| 10]],Serilog.FullNetFx, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10'. | |
| Stack Trace: | |
| at System.Data.SqlLocalDb.SqlLocalDbApi.GetInstanceNames() | |
| at System.Data.SqlLocalDb.SqlLocalDbProvider.GetInstances() |