- Open Xcode -> Preferences -> Components.
- Open the Console App, clear the console.
- Go back to the Xcode preferences. Start the simulator download, then cancel it.
- Now in the Console, you will see something about the cancellation with the download URL.
- Copy the URL from the Console, download it.
- Copy this file to ~/Library/Caches/com.apple.dt.Xcode/Downloads.
- If
Downloads
did not exist, create a newDownloads
directory. - If
Downloads
exists, remove all*.dvtdownloadableindex
files under it.
- If
- Open Xcode -> Preferences -> Components, start the simulator download again, it should find the file you downloaded and install it.
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
struct Form: Codable, Equatable { | |
let id: Int | |
let type: FType | |
let name: String | |
let code: String | |
let hasScreenshot: Bool | |
let total: Int | |
let totalUnique: Int | |
let opened: Int | |
@SomeKindOfBool var active: Bool |
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 CoreGraphics | |
import Accelerate | |
import CoreImage | |
import UIKit | |
extension CGImage { | |
public enum Error: Swift.Error { | |
case imageResizingFailed | |
case cgContextCreationFailed |
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 UIImageToDataIO(image: UIImage, compressionRatio: CGFloat, orientation: Int = 1) -> Data? { | |
return autoreleasepool(invoking: { () -> Data in | |
let data = NSMutableData() | |
let options: NSDictionary = [ | |
kCGImagePropertyOrientation: orientation, | |
kCGImagePropertyHasAlpha: true, | |
kCGImageDestinationLossyCompressionQuality: compressionRatio | |
] | |
let imageDestinationRef = CGImageDestinationCreateWithData(data as CFMutableData, kUTTypeJPEG, 1, nil)! |
DEPRECATED as of macOS 10.13 (High Sierra). See the new GUIDE to install nvm and yarn for macOS (updated July 2019)
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
This solution fixes the error caused by trying to run npm update npm -g
. Once you're finished, you also won't need to use sudo
to install npm modules globally.
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
// | |
// RecordAudio.swift | |
// | |
// This is a Swift class (updated for Swift 5) | |
// that uses the iOS RemoteIO Audio Unit | |
// to record audio input samples, | |
// (should be instantiated as a singleton object.) | |
// | |
// Created by Ronald Nicholson on 10/21/16. | |
// Copyright © 2017,2019 HotPaw Productions. All rights reserved. |
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
find . -iname "*.wma" -execdir bash -c 'NAME="{}" && ffmpeg -y -i "$NAME" -ab 192k "${NAME/.wma/.mp3}" -map_metadata 0:s:0 && rm "$NAME"' \; |
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
for f in *.JPG *.jpg; do convert "$f" -resize "1200x1200>" -quality 85 -verbose "$f"; done |
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 imageWithPixelSize(size: CGSize, filledWithColor color: UIColor = UIColor.clearColor(), opaque: Bool = false) -> UIImage { | |
return imageWithSize(size, filledWithColor: color, scale: 1.0, opaque: opaque) | |
} | |
func imageWithSize(size: CGSize, filledWithColor color: UIColor = UIColor.clearColor(), scale: CGFloat = 0.0, opaque: Bool = false) -> UIImage { | |
let rect = CGRectMake(0, 0, size.width, size.height) | |
UIGraphicsBeginImageContextWithOptions(size, opaque, scale) | |
color.set() | |
UIRectFill(rect) |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
let fontURL = NSBundle.mainBundle().URLForResource("PillGothic300mg-bold", withExtension: "ttf") | |
CTFontManagerRegisterFontsForURL(fontURL!, CTFontManagerScope.Process, nil) | |
var pillGothicFontBold = UIFont(name: "PillGothic300mg-bold", size: 30) | |
var attrs = [NSFontAttributeName : pillGothicFontBold!, |
NewerOlder