Skip to content

Instantly share code, notes, and snippets.

[This portion of call begins at 25:47]

Me: I could make it really easy on you, if you think Apollo is costing you $20 million per year, cut me a check for $10 million and we can both skip off into the sunset. Six months of use. We're good. That's mostly a joke.

Reddit: Six months of use? What do you mean? I know you said that was mostly a joke, but I want to take everything you're saying seriously just to make sure I'm not - what are you referring to?

Me: Okay, if Apollo's opportunity cost currently is $20 million dollars. At the 7 billion requests and API volume. If that's your yearly opportunity cost for Apollo, cut that in half, say for 6 months. Bob's your uncle.

Reddit: You cut out right at the end. I'm not asking you to repeat yourself for a third time, but you legit cut out right at the end. "If your opportunity cost is $10 million" and then I lost you.

Reddit Dec 5, 2022 10:46 AM:

Hi Christian,

I hope all is well!

I’m reaching out because we noticed a spike in Apollo's request rate on December 2nd. It was from approximately 14:17 to 14:23 UTC to /messages/inbox that went up by around 35% before returning to baseline. We are hoping you could help us understand what might have happened.

The source IPs were in AWS us-west-2: redacted, redacted, and redacted and had the Apollo UA server:apollo-backend:v1.0 (by /u/iamthatis) contact [email protected]

extension UserDefaults {
func favoriteSubreddits() -> [String] {
return stringArray(forKey: DefaultsKeys.favoriteSubreddits) ?? []
}
}
import UIKit
var startTime: CFAbsoluteTime!
class ViewController: UIViewController {
let movingView = UIView()
override func viewDidLoad() {
super.viewDidLoad()
import UIKit
import UIKit.UIGestureRecognizerSubclass
class ViewController: UIViewController {
let flickView = UIView()
var propertyAnimator: UIViewPropertyAnimator?
override func viewDidLoad() {
super.viewDidLoad()
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let separatorLine = UIView(frame: CGRect(x: 50.0, y: 0.0, width: 1.0, height: view.bounds.height))
separatorLine.backgroundColor = .systemRed
view.addSubview(separatorLine)
// Before 😕
let doingSomethingToOptionalView1: CGFloat? = {
guard let firstSubview = subviews.first else { return nil }
return (firstSubview.bounds.width / 2.0) + otherView.bounds.width
}()
// After 😊
let doingSomethingToOptionalView2 = subviews.first.useIfNotNil { ($0.bounds.width / 2.0) + otherView.bounds.width }
extension UIColor {
/// Blends this color into the specified color, as if this color was overlaid on top of the other at the specified alpha, but our result will instead be opaque. For instance if self was green, and we passed white and 0.1 alpha/opacity, the result would be a light, faded green.
///
/// - Note: This process is also called alpha compositing.
func blend(intoColor otherColor: UIColor, atOpacity alpha: CGFloat) -> UIColor {
let sourceRGB = rgb
let otherRGB = otherColor.rgb
return UIColor(
red: (sourceRGB.red * alpha) + (otherRGB.red * (1.0 - alpha)),
import SwiftUI
struct ContentView: View {
@State var show: Bool = false
var body: some View {
ZStack {
Button {
show.toggle()
} label: {
struct ContentView: View {
var body: some View {
Text(attributedString)
}
var attributedString: AttributedString {
var attributes = AttributeContainer()
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineSpacing = 10.0