Skip to content

Instantly share code, notes, and snippets.

View lkoskela's full-sized avatar

Lasse Koskela lkoskela

View GitHub Profile
@lkoskela
lkoskela / UIColor+Contrast.swift
Created March 30, 2017 11:46
Utility for calculating the relative luminance and contrast ratio of two colors to determine whether they meet the recommendation set forth by the W3's Web Content Accessibility Guidelines 2.0.
import UIKit
extension UIFont {
private var weight: CGFloat {
if let traits = fontDescriptor.object(forKey: UIFontDescriptorTraitsAttribute) as? NSDictionary,
let weight = traits[UIFontWeightTrait] as? CGFloat {
return weight
}
return 0
}

Keybase proof

I hereby claim:

  • I am lkoskela on github.
  • I am lkoskela (https://keybase.io/lkoskela) on keybase.
  • I have a public key whose fingerprint is 1513 ED7A BB8B 4DFC 0309 4C34 7217 C1BD 3E9D 0889

To claim this, I am signing this object:

Incident Identifier: A0A147B2-0C7C-4616-B01E-058776B38843
CrashReporter Key: df2d4a61f3e302eb8ba082de8a1a73cb77d3ddc9
Hardware Model: iPhone7,2
Process: mediaserverd [248]
Path: /usr/sbin/mediaserverd
Identifier: mediaserverd
Version: ???
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Incident Identifier: 667DAE39-218B-467B-9879-CC07916357A3
CrashReporter Key: df2d4a61f3e302eb8ba082de8a1a73cb77d3ddc9
Hardware Model: iPhone7,2
OS Version: iPhone OS 8.0.2 (12A405)
Kernel version: Darwin Kernel Version 14.0.0: Thu Sep 18 21:48:08 PDT 2014; root:xnu-2783.1.72~23/RELEASE_ARM64_T7000
Date: 2014-10-14 13:42:12 +0300
Exception Code: 0xbe18d1ee
Reason: AudioQueueConvertToScaledSampleTime: Mach message timeout within mediaserverd. Apparently deadlocked. Aborting now.
Thermal data unavailable
Incident Identifier: BC6EF1BE-C4A3-47AF-ADD7-982FB3DB94DE
CrashReporter Key: df2d4a61f3e302eb8ba082de8a1a73cb77d3ddc9
Hardware Model: iPhone7,2
Process: mediaserverd [1805]
Path: /usr/sbin/mediaserverd
Identifier: mediaserverd
Version: ???
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Incident Identifier: 08B5FB75-B95F-47F1-8937-187BF8D31B32
CrashReporter Key: df2d4a61f3e302eb8ba082de8a1a73cb77d3ddc9
Hardware Model: iPhone7,2
OS Version: iPhone OS 8.0.2 (12A405)
Kernel version: Darwin Kernel Version 14.0.0: Thu Sep 18 21:48:08 PDT 2014; root:xnu-2783.1.72~23/RELEASE_ARM64_T7000
Date: 2014-10-13 11:36:03 +0300
Exception Code: 0xbe18d1ee
Reason: AudioQueuePause: Mach message timeout within mediaserverd. Apparently deadlocked. Aborting now.
Thermal data unavailable
Incident Identifier: 81F2A072-5AD9-46DF-A754-622B4F04ED85
CrashReporter Key: df2d4a61f3e302eb8ba082de8a1a73cb77d3ddc9
Hardware Model: iPhone7,2
OS Version: iPhone OS 8.0.2 (12A405)
Kernel version: Darwin Kernel Version 14.0.0: Thu Sep 18 21:48:08 PDT 2014; root:xnu-2783.1.72~23/RELEASE_ARM64_T7000
Date: 2014-10-13 11:36:03 +0300
Exception Code: 0xbe18d1ee
Reason: mediaserverd: RPCTimeout message received to terminate [1805] with reason 'fig rpc timeout -- playerremote_CopyProperty [ PIDToInheritApplicationStateFrom ]'
Thermal data unavailable

Keybase proof

I hereby claim:

  • I am lkoskela on github.
  • I am lkoskela (https://keybase.io/lkoskela) on keybase.
  • I have a public key whose fingerprint is 0BC7 11AB 7A44 8821 AACA 0066 B291 E8BC BF55 6A41

To claim this, I am signing this object: