Skip to content

Instantly share code, notes, and snippets.

View saraheolson's full-sized avatar

Sarah E. Olson saraheolson

View GitHub Profile
protocol HeartRateDelegate {
func heartRateUpdated(heartRateSamples: [HKSample])
}
var heartRateDelegate: HeartRateDelegate?
func createHeartRateStreamingQuery(_ workoutStartDate: Date) -> HKQuery? {
...
var anchor: HKQueryAnchor?
func createHeartRateStreamingQuery(_ workoutStartDate: Date) -> HKQuery? {
guard let heartRateType: HKQuantityType = HKQuantityType.quantityType(forIdentifier: .heartRate) else {
print("Could not get heart rate type")
return nil
}
let datePredicate = HKQuery.predicateForSamples(withStart: workoutStartDate,
end: nil,
@saraheolson
saraheolson / test1.php
Created June 27, 2014 17:58
Test File 1
<?php
echo 'Hellow World';
<?php
function my_admin_notification_profile_update($userid) {
$userdata = get_userdata($userid);
$message = "A user profile has been updated\n\n";
$message .= print_r($userdata,true);
@wp_mail(get_option('admin_email'), 'User Profile Update', $message);
}
@saraheolson
saraheolson / test.html
Created June 27, 2014 14:37
Testing HTML snippet
<html>
<head><title>Test Snippet</title></head>
<body>
Hello World!
</body>
</html>
@saraheolson
saraheolson / functions_snippet.php
Last active May 3, 2018 09:27
Email Notification on User Profile Change (WordPress)
<?php
/**
* Add this snippet to your functions.php file
*/
function my_admin_notification_profile_update($userid) {
$userdata = get_userdata($userid);
$message = "A user profile has been updated\n\n";
$message .= print_r($userdata,true);
@wp_mail(get_option('admin_email'), 'User Profile Update', $message);