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
public class ExceptionFilter : IExceptionFilter | |
{ | |
private readonly ILogger<ExceptionFilter> _logger; | |
public ExceptionFilter(ILogger<ExceptionFilter> logger) | |
{ | |
_logger = logger; |
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
internal static class StringExtensions | |
{ | |
public static string TruncateTo(this string val, int maxLength, bool ellipsis = true) | |
{ | |
if (val == null || val.Length <= maxLength) | |
{ | |
return val; | |
} | |
ellipsis = ellipsis && maxLength >= 3; |
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
public class PlanetConfiguration | |
{ | |
public List<Planet> Planets { get; set; } | |
public class Planet | |
{ | |
public string Code { get; set; } | |
public int Id { get; set; } |
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
public static class ServiceCollectionExtensions | |
{ | |
public static IServiceCollection AddAdapterApiTestClient(this IServiceCollection services, string apiUri, ConcurrentBag<DaResponse> receivedResponses) | |
{ | |
services.AddHttpClient<ApiClient>(client => client.BaseAddress = new Uri(apiUri)); | |
services | |
.AddSingleton<IAdapterApiClient, ApiClientSpy>(provider => | |
new ApiClientSpy(provider.GetRequiredService<ApiClient>(), receivedResponses)); |
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
{ | |
"size": 0, | |
"query": { | |
"bool": { | |
"must": [{ | |
"range": { | |
"Data.Attributes.Time": { | |
"gt": "2018-03-10T00:00:00" | |
} | |
} |
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
using System; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Extensions.Http; | |
using Microsoft.Azure.WebJobs.Host; | |
namespace AzBlobFuncApp |
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
/// <summary> | |
/// given the list of items [1,2,3] and the count 2, | |
/// break the list into 2 lists containing 1 in 1st list and 2,3 in 2nd list and so on. | |
/// </summary> | |
/// <typeparam name="T">type</typeparam> | |
/// <param name="items">item list</param> | |
/// <param name="listCount">no of lists to produce</param> | |
/// <returns>listCount no of lists containing the items. last list contains the rest</returns> | |
public static List<List<T>> ToChunks<T>(this IEnumerable<T> items, int listCount) | |
{ |
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
using System; | |
using MassTransit; | |
using Core.Runtime.Events; | |
using Core.Runtime.Events.Tracking.Contracts; | |
using Core.Runtime.Logging; | |
using Core.Utils.Extensions; | |
namespace Oklo.Shared.Runtime | |
{ | |
public abstract class EventHandlerBase |
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
using DinkLabs.Runtime.Logging; | |
namespace DinkLabs.Web.Core.Logging | |
{ | |
public class Log4NetTraceListener : System.Diagnostics.TraceListener | |
{ | |
private readonly ILog _log; | |
public Log4NetTraceListener(string provider) | |
{ |
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
import re | |
import getpass | |
import sys | |
import telnetlib | |
import time, threading | |
from subprocess import check_output | |
def routerTelnet(): | |
print (time.ctime()) | |
NewerOlder