Liked on YouTube: Binging with Babish: Pasta Aglio e Olio from “Chef”

https://youtu.be/bJUiWdM__Qw

What dish can make any man or woman ache for the touch of Jon Favreau? Pasta Aglio e Olio is the dreamy midnight snack that lives up to its porny portrayal in the foodie-comedy-drama “Chef”. Recipe below!

RECIPE

*Ingredients*

1/2 head garlic, separated and peeled

1 bunch parsley, rinsed

1/2 cup good quality olive oil

1 tsp red pepper flakes

1/2 lb dry linguine

1/2 lemon

*Method*

Heavily salt a large pot of water, and bring to a boil. Cook pasta to al dente while completing the steps below.

Slice the garlic cloves thinly, and set aside. Pick the parsley leaves from their stems, and finely chop. Add olive oil to a large sauté pan, and heat over medium flame until shimmering. Add sliced garlic, stirring constantly, until garlic is barely toasted. Add the red pepper flake and remove from heat.

Add the pasta, drained, with about 1/4 cup reserved pasta cooking water. Add lemon juice and parsley, and toss to combine. Season for salt and pepper, and serve.

Binging With Babish Website: http://bit.ly/BingingBabishWebsite
Basics With Babish Website: http://bit.ly/BasicsWithBabishWebsite
Patreon: http://bit.ly/BingingPatreon
Instagram: http://bit.ly/BabishInstagram
Facebook: http://bit.ly/BabishFacebook
Twitter: http://bit.ly/BabishTwitter

via Binging with Babish: Pasta Aglio e Olio from “Chef”

Requesting access to HealthKit

I’m playing with starting to blog again.

This is the type of thing that I might enjoy posting.

I have a bunch of these, and this might be a good place to save them for posterity.

import HealthKit

 

static var healthStore: HKHealthStore = HKHealthStore()

var healthKitAuthorized = false

 

var dataTypesToWrite = Set<HKSampleType>()

var dataTypesToRead = Set<HKObjectType>()

 

func requestAccessToHealthKit(completion: ((Bool, Error?) -> Void)!) {

    if HKHealthStore.isHealthDataAvailable() {

        healthStore.requestAuthorization(toShare: dataTypesToWrite,

                read: dataTypesToRead) { success, error in

            if !success {

                print(Error: \(error!.localizedDescription.description)”)

            } else {

                healthKitAuthorized = true

            }

            if (completion != nil) {

                completion(success, error)

            }

        }

    } else {

        print(“HealthKit is not available on this device.”)

    }

}

 

func doStuff() {

    dataTypesToWrite = Set([

        HKObjectType.quantityType(forIdentifier:

            HKQuantityTypeIdentifier.height)!,

        HKObjectType.quantityType(forIdentifier:

            HKQuantityTypeIdentifier.bodyMass)!

        ])

    dataTypesToRead = Set([

        HKObjectType.quantityType(forIdentifier:

            HKQuantityTypeIdentifier.height)!,

        HKObjectType.quantityType(forIdentifier:

            HKQuantityTypeIdentifier.bodyMass)!

        ])

    requestAccessToHealthKit { [weak self] (success, error) in

        if success {

            // Go ahead and work with HealthKit height and weight samples…

            DispatchQueue.main.async {

                // You’re in a background queue…

                // …so if you’re going to work with the user interface…

                // …be sure to wrap it in a dispatch to the main queue.

            }

        }

    }

}

 

Customize the messages displayed on the permissions sheet by setting the following keys in your app’s info.plist file. Set the NSHealthShareUsageDescription (Privacy – Health Share Usage Description) key to customize the message for reading data. Set the NSHealthUpdateUsageDescription (Privacy – Health Update Usage Description) key to customize the message for writing data.

Test

This is the default text in the visual editor.

If I do too much, does something bad happen? 🤔