Download this icon and drag it into your Assets.xcassets
.
AppDelegate.swift
func getLux() { | |
guard let serviceType = IOServiceMatching("AppleLMUController") else { | |
debugPrint("No ambient light sensor") | |
return | |
} | |
// get and release service | |
let service = IOServiceGetMatchingService(kIOMasterPortDefault, serviceType) | |
defer { | |
IOObjectRelease(service) |
private func getActiveDisplays() -> [CGDirectDisplayID] { | |
var displayCount: UInt32 = 0 | |
// get the number of active displays | |
guard CGGetActiveDisplayList(0, nil, &displayCount) == .success else { | |
return [] | |
} | |
// get the active displays | |
let allocated = Int(displayCount) |
# 100 connections, 10 second duration, 4 threads | |
wrk -c 100 -d 10 -t 4 http://localhost:8080 |
//: Playground - noun: a place where people can play | |
import UIKit | |
//[{ | |
// "508d49e5d7200200b96d45a3ce6103c4":[{ // filter widget id | |
// "table":"incident", | |
// "filter":"categoryINsoftware" | |
// }], | |
// "id":”508d49e5d7200200b96d45a3ce6103c4” // filter widget id |
After formatting an USB drive and naming it SierraBootInstall
, execute the following line:
sudo /Applications/Install\ macOS\ 10.13\ beta.app/Contents/Resources/createinstallmedia --volume /Volumes/SierraBootInstall --applicationpath /Applications/Install\ macOS\ 10.13\ beta.app --nointeraction &&say Done
iPhoneOS.Platform
's DeviceSupport
into Xcode 8 (guide):sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0\ \(15A5278f\) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0
A list of methods and functions to use when optimizing your iOS application for performance.
import Foundation | |
extension UIView { | |
class func fromNib<T : UIView>() -> T { | |
//swiftlint:disable:next force_unwrapping | |
return Bundle.main.loadNibNamed(String(describing: T.self), owner: nil, options: nil)![0] as! T | |
} | |
} |
#!/usr/bin/env bash | |
#source: https://9to5mac.com/2017/10/17/how-to-erase-macbook-pro-touch-bar-before-selling/ | |
xartutil --erase-all |