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
| public class QueueHealthCheck : IHealthCheck | |
| { | |
| private bool _isHealthy; | |
| private string _message = "Trying to connect"; | |
| public void SetAsHealthy() | |
| { | |
| _isHealthy = true; | |
| _message = string.Empty; | |
| } |
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
| // _queueHealthCheck is injected as a singleton | |
| private async Task<IConnection> EnsureRabbitMqConnection() | |
| { | |
| while (true) | |
| { | |
| try | |
| { | |
| var connection = _connectionFactory(); | |
| connection.ConnectionBlocked += (_, args) => |
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
| // JS array equivalents to C# LINQ methods - by Dan B. | |
| // Here's a simple array of "person" objects | |
| var people = [ | |
| { name: "John", age: 20 }, | |
| { name: "Mary", age: 35 }, | |
| { name: "Arthur", age: 78 }, | |
| { name: "Mike", age: 27 }, | |
| { name: "Judy", age: 42 }, | |
| { name: "Tim", age: 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
| name: .NET Core | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: |
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
| # EditorConfig is awesome: https://EditorConfig.org | |
| # top-most EditorConfig file | |
| root = true | |
| # Don't use tabs for indentation. | |
| [*] | |
| indent_style = space | |
| # (Please don't specify an indent_size here; that has too many unintended consequences.) |
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 a bookmark and use this code as the URL, you can now toggle the css on/off | |
| // thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
| javascript: (function() { | |
| var style = 'html * { background: rgba(255, 0, 0, .1); box-shadow: 0 0 0 1px red; }' | |
| var elements = document.body.getElementsByTagName('*'); | |
| var items = []; | |
| for (var i = 0; i < elements.length; i++) { | |
| if (elements[i].innerHTML.indexOf(style) != -1) { | |
| items.push(elements[i]); | |
| } |
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
| # Starter pipeline | |
| # Start with a minimal pipeline that you can customize to build and deploy your code. | |
| # Add steps that build, run tests, deploy, and more: | |
| # https://aka.ms/yaml | |
| trigger: | |
| - master | |
| pool: | |
| vmImage: 'Ubuntu-16.04' |
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
| Import-Module Powerline | |
| function Get-PushedLocationCount { | |
| if ($pushed = (Get-Location -Stack).Count) { New-PromptText " »$pushed " -BackgroundColor "#00af87" -ForegroundColor "#000000" } | |
| } | |
| function Get-GitBranchName { | |
| if (Get-Command git -ErrorAction SilentlyContinue) { | |
| if ($(git rev-parse --is-inside-work-tree 2>$null)) { | |
| $branch = $(git symbolic-ref HEAD 2>$null).ToString().Substring(11) |
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 System.Text; | |
| namespace FizzBuzz | |
| { | |
| static class Program | |
| { | |
| static void Main(string[] args) |
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.serviceModel> | |
| <behaviors> | |
| <serviceBehaviors> | |
| <behavior> | |
| <useRequestHeadersForMetadataAddress/> | |
| </behavior> | |
| </serviceBehaviors> | |
| </behaviors> | |
| </system.serviceModel> |
NewerOlder