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
{ | |
"openapi": "2.0.1", | |
"info": { | |
"title": "MMS.TradingAccounts.Api", | |
"version": "1.0" | |
}, | |
"servers": [ | |
{ | |
"url": "http://trading-accounts.uat.zfx.loc/trading-accounts/" | |
} |
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
{ | |
"index-name-2018.07.31": { | |
"aliases": {}, | |
"mappings": { | |
"doc": { | |
"properties": { | |
"@timestamp": { | |
"type": "date" | |
}, | |
"time": { |
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
RestClient client = new RestClient(); | |
RestRequest request = new RestRequest(); | |
request.AddParameter("domain", domain, ParameterType.UrlSegment); | |
request.Resource = "{domain}/messages"; | |
request.AddParameter("from", sender); | |
request.AddParameter("to", sendTo); | |
request.AddParameter("subject", "..."); | |
request.AddParameter("text", "..."); | |
request.Method = Method.POST; |
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 interface IBackoffStrategy | |
{ | |
void RetryOnException(Action<Int32> intent, Int32 maxAttempts); | |
void RetryOnPredicate(Action<Int32> intent, Int32 maxAttempts, Func<Boolean> condition); | |
T RetryOnException<T>(Func<Int32, T> retrieve, Int32 maxAttempts); | |
T RetryOnOperationResult<T>(Func<Int32, T> retrieve, Int32 maxAttempts, Func<T, Boolean> retryCondition); | |
} |
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 CustomGeocodeProxyProvider : IGeocodeProxyProvider | |
{ | |
private Uri baseUri; | |
public CustomGeocodeProxyProvider(string baseUrl) | |
{ | |
baseUri = new Uri(baseUrl); | |
} | |
public HttpWebRequest CreateRequest(string url) |
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.Collections.Generic; | |
using System.Linq; | |
namespace GeocodeSharp | |
{ | |
public class NginxProxyRequestBuilder : DefaultRequestBuilder | |
{ | |
public NginxProxyRequestBuilder(string domain, bool isProtected = true) : base(domain, isProtected) | |
{ | |
} |
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 abstract class RequestBuilderBase | |
{ | |
protected readonly string _clientKey; | |
protected readonly UsageMode _mode; | |
protected readonly string _clientId; | |
protected readonly string _cryptoKey; | |
protected string _domain = "https://maps.googleapis.com"; | |
protected const string _apiPath = "/maps/api/geocode/json?"; |
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
static void GitCommit(String message) | |
{ | |
var processPath = @"C:\Program Files (x86)\Git\bin\git.exe"; | |
var filePath = @"D:\whatever\git-tests\text.txt"; | |
File.AppendAllText(filePath, DateTime.UtcNow.ToString("s") + Environment.NewLine); | |
using (var process = new Process() | |
{ | |
StartInfo = new ProcessStartInfo(processPath, string.Format(" commit -am \"{0}\"", message)) |
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
var http = require('http'); | |
var express = require('express'); | |
var winston = require('winston'); | |
//set up Winston - not really relevant | |
var logger = ... | |
var app = express(); | |
app.set('view engine', 'jade'); | |
app.set('views', './views'); |
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
var http = require('http'); | |
var express = require('express'); | |
var winston = require('winston'); | |
var logger = ... | |
//setup Winston logger here, not really important | |
var app = express(); | |
app.set('view engine', 'jade'); | |
app.set('views', './views'); |
NewerOlder