Algorithms for Online Matching, Assortment, and Pricing with Tight Weight-dependent Competitive Ratios