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 credentials = new Credentials(login, password); | |
var credentialStore = new InMemoryCredentialStore(credentials); | |
var productHeaderValue = new ProductHeaderValue("MyAmazingApp"); | |
var connection = new Connection(productHeaderValue, credentialStore); | |
var apiConnection = new ApiConnection(connection); | |
var issues = new IssuesClient(apiConnection); | |
var closedSince1Point2 = issues.GetForRepository("ownerLogin", "repoName", new RepositoryIssueRequest() |
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
try | |
{ | |
// Create the service. | |
var service = new StorageService(new BaseClientService.Initializer | |
{ | |
ApplicationName = "TestinInTheCloud", | |
ApiKey = "API-KEY" | |
}); | |
// Run the request. |
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
from epi in docs.ExchangePoints | |
select new | |
{ | |
Value = epi.FixedAt.AsZonedDateTime().ToOffsetDateTime().Resolve() | |
}; | |
from result in results | |
group result by 0 | |
into g | |
select new |
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'); |
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
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
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
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 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
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); | |
} |