Skip to content

Instantly share code, notes, and snippets.

View aconfee's full-sized avatar

Adam Estela aconfee

  • Spotify
  • Austin, TX
View GitHub Profile
var targetPrice = null;
if (priceGuideType === PriceGuideType.Radar && priceEstimate.UseProvisionSetting) {
targetPrice = wrapper.Financials.TargetPricePct;
var method = this.settings[EntitySettingDefinitions.Stocking_TargetPriceCalculationMethod];
if (method.toLowerCase().indexOf("pricingtarget") >= 0) {
var pricingTargets = priceEstimate.PricingTargets;
var defaultRuleSet = pricingTargets.RuleSets.filter(ruleSet => { return ruleSet.Id === pricingTargets.DefaultRuleSetId; })[0];
if (profile.RetailPriceEstimate.UseProvisionSetting.HasValue &&
profile.RetailPriceEstimate.UseProvisionSetting.Value)
{
profile.RetailPriceEstimate.SelectedBook = PriceGuideId.RADAR;
}
if (profile.WholesalePriceEstimate.UseProvisionSetting.HasValue &&
profile.WholesalePriceEstimate.UseProvisionSetting.Value)
{
profile.WholesalePriceEstimate.SelectedBook = PriceGuideId.RADAR;
filters = fd.Terms(av => av.Vin, vins) &&
fd.Or(
d => d.Range(f => f.OnField(ff => ff.AuctionDate)
.GreaterOrEquals(DateTime.Now.AddDays(daysHistory * -1).ToString("yyyyMMdd"))),
d => d.Term(f => f.AuctionDate, null)
) &&
BuyerGroupSearchHelper.BuildBuyerGroupsFilter(fd, buyerGroups);
@aconfee
aconfee / README.md
Created April 28, 2018 20:58
create-react-app initial README
public class MessageOperationPacket<TMessage>
{
public MessageOperationPacket(QueueItem queueItem)
{
this.queueItem = queueItem;
}
protected QueueItem queueItem { get; }
protected TMessage data
private void AutoGenEntryDetailSequenceNumbers()
{
AchFile.Batches.ToList().ForEach(batch =>
{
var currentMaxSequenceNumber = batch.EntryDetails.Max(d => d.EntryDetailSequenceNumber);
batch.EntryDetails.OrderBy(d => d.EntryDetailSequenceNumber).ToList()
.ForEach(d => d.EntryDetailSequenceNumber = d.EntryDetailSequenceNumber ?? ++currentMaxSequenceNumber);
});
}
@aconfee
aconfee / gist:232148a16c9d495855567a98e9dbea52
Created July 23, 2020 14:35
Swap Lex Order CodeSignal
string swapLexOrder(string str, int[][] pairs) {
// If 1 can swap with 3, and 3 can swap with 4, then 1 can eventually swap with 4. Transitive.
// For this reason we can build a graph -- connected components that have all the positions of possible
// would-be swaps.
// We end up just putting the sorted letters (vertices) in the positions that would be possible to swap them to.
// 1. Build adjacency list (beginner/intermediate graph theory)
var adjacencyLists = new Dictionary<int, List<int>>();
foreach(var pair in pairs)
{