ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/nullbrew cask install visual-studio-code| // plain write to image | |
| @discardableResult func writeCGImage(_ image: CGImage, to destinationURL: URL) -> Bool { | |
| guard let destination = CGImageDestinationCreateWithURL(destinationURL as CFURL, kUTTypePNG, 1, nil) else { return false } | |
| CGImageDestinationAddImage(destination, image, nil) | |
| return CGImageDestinationFinalize(destination) | |
| } | |
| // There's a panel, save image png |