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.Concurrent; | |
| using System.Threading; | |
| using System.Timers; | |
| using System.Web; | |
| namespace LeakyBucket | |
| { | |
| public class PerClientRateLimitHandler : IHttpHandler | |
| { |
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.Threading; | |
| using System.Timers; | |
| using System.Web; | |
| namespace LeakyBucket | |
| { | |
| public class RateLimitHandler : IHttpHandler | |
| { | |
| private static System.Timers.Timer timer; |
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
| namespace ScratchPad | |
| { | |
| class Program | |
| { | |
| public static void Main(string[] args) | |
| { | |
| var str = "-"; | |
| int? x; | |
| x = str == "-" ? (int?) null : 3; |
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
| <script type="text/template" class="template"> | |
| <% _.each(rc, function(endpoint) { %> | |
| <% var isEndpointHealthy = !_.find(endpoint.Results, function(result) { return !result.IsHealthy; }) %> | |
| <h4><%- endpoint.EndPoint %> <% if (!isEndpointHealthy) { %>Not <% } %>Healthy</h4> | |
| <% _.each(endpoint.Results, function(result) { %> | |
| <h5><%- result.Name %></h5> | |
| <ul> | |
| <li>Healthy: <%- result.IsHealthy %></li> | |
| <li>Messsage: <%- result.Message%></li> | |
| <li>Exception: <%- result.Exception %></li> |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <TestSettings name="TestSettings" id="c988b33e-e14f-4f61-9675-c0bac08f1429" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> | |
| <Description>These are default test settings for a local test run.</Description> | |
| <Deployment enabled="false" /> | |
| <Execution parallelTestCount="4"> | |
| <Timeouts runTimeout="60000" testTimeout="0" /> | |
| <TestTypeSpecific> | |
| <UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b"> | |
| <AssemblyResolution> | |
| <TestDirectory useLoadContext="true" /> |
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 ThePast | |
| { | |
| public class User | |
| { | |
| public string FirstName { get; set; } | |
| public string LastName { get; set; } | |
| public string EmailAddress { get; set; } | |
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 GetOrElse | |
| { | |
| public static class GetOrElseExtension | |
| { | |
| public static T GetOrElse<T>(this Nullable<T> instance, T orElse) where T: struct | |
| { | |
| if (instance == null) | |
| return orElse; |