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.Linq; | |
| using State; | |
| public class Program { | |
| public static void Main () { | |
| var ctx = new StateClient (); | |
| ctx.State = new StateOne (ctx); | |
| Assert.Equal ("StateOne", ctx.State.GetType ().Name); |
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.Linq; | |
| namespace ChainOfResponsibility { | |
| /// <summary> | |
| /// The 'Handler' abstract class | |
| /// </summary> | |
| public abstract class Approver { | |
| public string Id { get; } |
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.Linq; | |
| namespace ChainOfResponsibility { | |
| /// <summary> | |
| /// The 'Handler' abstract class | |
| /// </summary> | |
| public abstract class Approver { | |
| public string Id { get; } |
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; | |
| namespace Interpreter { | |
| public abstract class AbstractInterpreter { | |
| public abstract int Interpret (Context context); | |
| } | |
| } | |
| namespace Interpreter { | |
| public class Context { |
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; | |
| namespace Memento { | |
| public class Caretaker : Stack<Memento> { } | |
| } | |
| namespace Memento { | |
| public class Memento { | |
| public (string Id, int balance) State { get; private set; } | |
| //probably better to use read-only state |
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 SingletonExample; | |
| using System.Collections.Generic; | |
| public class Program | |
| { | |
| public static void Main() | |
| { | |
| var s1 = Singleton.Instance; | |
| var s2 = Singleton.Instance; |
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
| #!/bin/sh | |
| # grep -R --include "*.bs" 'error\[.*\]' $PROJECT_PATH | cut -d' ' -f9- | sort | uniq | |
| geterr4m() { | |
| METHOD_NAME="$1" | |
| PROJECT_PATH='/c/Nikiforov/dev/nuts-bella/src/Domain/components/'; | |
| # echo $METHOD_NAME $PROJECT_PATH | |
| METHOD_PATH=$(grep -rl --include "*.bs" "re.*${METHOD_NAME}" $PROJECT_PATH) |
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
| Create the Gist | |
| Drag an image into the comment field below. This will upload your image file and insert the markdown code with the url for your uploaded image. | |
| Copy this markdown and paste it into the file you want to display it. |
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
| *.doc diff=astextplain | |
| *.DOC diff=astextplain | |
| *.docx diff=astextplain | |
| *.DOCX diff=astextplain | |
| *.dot diff=astextplain | |
| *.DOT diff=astextplain | |
| *.pdf diff=astextplain | |
| *.PDF diff=astextplain | |
| *.rtf diff=astextplain | |
| *.RTF diff=astextplain |
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
| 23:53:31.418 2>Done building target "Restore" in project "Tools.proj".: (TargetId:31) | |
| 23:53:31.418 2>Target "InstallDotNetCore: (TargetId:32)" in file "<removed>\.nuget\packages\microsoft.dotnet.arcade.sdk\5.0.0-beta.20228.4\tools\InstallDotNetCore.targets" from project "<removed>\.nuget\packages\microsoft.dotnet.arcade.sdk\5.0.0-beta.20228.4\tools\Tools.proj" (entry point): | |
| Set Property: _DotNetInstallScript=<removed>\dev\tye\eng\common\dotnet-install.cmd | |
| Task "Exec" skipped, due to false condition; ('$(OS)' != 'Windows_NT') was evaluated as ('Windows_NT' != 'Windows_NT'). | |
| Using "InstallDotNetCore" task from assembly "<removed>\.nuget\packages\microsoft.dotnet.arcade.sdk\5.0.0-beta.20228.4\tools\netcoreapp2.1\Microsoft.DotNet.Arcade.Sdk.dll". | |
| Task "InstallDotNetCore" (TaskId:30) | |
| Task Parameter:VersionsPropsPath=<removed>\dev\tye\eng\Versions.props (TaskId:30) | |
| Task Parameter:GlobalJso |