This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.consoleConfig = function(useConsole,useAlert) | |
{ | |
if (arguments.length == 0) { | |
var useConsole = true; | |
var useAlert = true; | |
} else if (arguments.length == 1) { | |
var useAlert = true; | |
} | |
if (!window.console || !useConsole) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// HKHealthStore-DeleteObjects.swift | |
// HealthKitTest | |
// | |
// Created by Ben Dodson on 06/10/2015. | |
// Copyright © 2015 Dodo Apps. All rights reserved. | |
// | |
import Foundation | |
import HealthKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
func randomColor(seed: String) -> UIColor { | |
var total: Int = 0 | |
for u in seed.unicodeScalars { | |
total += Int(UInt32(u)) | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func runMediaLibraryQuery() { | |
let query = MPMediaQuery.playlists() | |
if let playlists = query.collections { | |
for playlist in playlists { | |
if let playlistName = playlist.value(forKey: MPMediaPlaylistPropertyName) { | |
NSLog("Playlist: \(playlistName)") | |
if let item = playlist.items.first, let title = item.title { | |
NSLog("First track: \(title)") | |
} | |
} |