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.Linq; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using Microsoft.AspNetCore.Routing; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
namespace GithubPullerDemo | |
{ | |
public class GitHubRepo |
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 class Program | |
{ | |
public static IConfigurationRoot Configuration { get; } | |
public static ILoggerFactory LoggerFactory { get; } | |
public static DbConnectionStringBuilder DbConnectionStringBuilder { get; } | |
static Program() | |
{ | |
Configuration = new ConfigurationBuilder() | |
.AddEnvironmentVariables("TROICENETDEV_") | |
.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
public class StatusController : Controller | |
{ | |
public ILoggerFactory LoggerFactory { get; } | |
public DbConnectionStringBuilder ConnectionStringBuilder { get; } | |
public StatusController(DbConnectionStringBuilder connectionStringBuilder, ILoggerFactory loggerFactory) | |
{ | |
ConnectionStringBuilder = connectionStringBuilder; | |
LoggerFactory = loggerFactory; | |
} | |
} |
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 Startup | |
{ | |
public IConfigurationRoot Configuration { get; } | |
public ILoggerFactory LoggerFactory { get; } | |
public DbConnectionStringBuilder DbConnectionStringBuilder { get; } | |
public Startup() | |
{ | |
Configuration = new ConfigurationBuilder() | |
.AddEnvironmentVariables("TROICENET_") |
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
scp root@oldhost:/root/.bash_history /tmp/migrate.sh | |
sudo sh /tmp/migrate.sh |
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 apolloUpdateAdjustment = new Apollo.UpdateAdjustment | |
{ | |
supply = record["SUPPLY"].ToString(), | |
prosales = record["ProSales"].ToString(), | |
release_date = record["Release Date"].ToString(), | |
reason_for_update = record["Reason For Update"].ToString(), | |
itemid = Convert.ToInt64(record["ItemID"].ToString()), | |
}; |
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 apolloUpdateAdjustment = new Apollo.UpdateAdjustment(); | |
apolloUpdateAdjustment.itemid = Convert.ToInt64(record["ItemID"].ToString()); | |
apolloUpdateAdjustment.reason_for_update = record["Reason For Update"].ToString(); | |
apolloUpdateAdjustment.release_date = record["Release Date"].ToString(); | |
apolloUpdateAdjustment.prosales = record["ProSales"].ToString(); | |
apolloUpdateAdjustment.supply = record["SUPPLY"].ToString(); |
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 static void ImportPricingFile() | |
{ | |
using (var streamReader = new StreamReader(@"C:\Users\d.gallmeier\gits\daytoday\20180308\pricingFile.csv")) | |
using (var csv = new CsvReader(streamReader)) | |
using (var db = new SqlConnection(Config.AthenaConnectionString)) | |
{ | |
var pricingLines = csv | |
.GetRecords<dynamic>() | |
.Select(record => | |
{ |
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
private static List<CriterionBidLandscape> GetCriterionBidLandscapes(DataService dataService, string awql) | |
{ | |
var bidLandscapes = Enumerable | |
.Range(0, Int32.MaxValue) | |
.AggregateUntil( | |
new CriterionBidLandscapePage() | |
{ | |
entries = new CriterionBidLandscape[] { }, | |
totalNumEntries = 0, | |
}, |
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 static TAccumulate AggregateUntil<TSource, TAccumulate>(this IEnumerable<TSource> source, | |
TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate,bool> untilFunc) | |
{ | |
if (source == null) | |
{ | |
throw new ArgumentNullException(nameof(source)); | |
} | |
if (func == null) | |
{ |