I hereby claim:
- I am jpsim on github.
- I am jpsim (https://keybase.io/jpsim) on keybase.
- I have a public key ASBwmCI1FZ8tNZxDyhrZwx06OrlGAWufb1hQDmLWXD7IWgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Here are Commandant's docs built on Linux with Jazzy and SourceKitten: https://static.realm.io/jazzy_demo/Commandant
The rough steps are:
libsourcekitdInProc.so
and Swift 3 available.These are the file attachments for rdar://31302382.
# Spin up a beefy Digital Ocean droplet
doctl compute droplet create swift-dev --size m-224gb --image ubuntu-16-10-x64 --region sfo2 --ssh-keys XXXXXXX
doctl compute ssh swift-dev
# Install dependencies
apt-get update
apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev autoconf libtool systemtap-sdt-dev tzdata
# Clone & build Swift
Running jazzy from a fresh Ubuntu machine:
Create a brand new Ubuntu machine
$ doctl compute droplet create jazzy --size 16gb \
--image ubuntu-16-10-x64 --region sfo1
$ doctl compute ssh jazzy
Install Swift
#import <Foundation/Foundation.h> | |
#import <QuartzCore/QuartzCore.h> | |
#import <iostream> | |
#import <vector> // Needed for gist to compile. | |
#pragma mark - Pure Implementation Functions | |
const static unichar kUTF16Newline = (unichar)'\n'; // old naming habits die hard! | |
/** | |
* Calculates an array of line end "positions" for a given string. | |
* The equivalent Swift function was `(String) -> [Int]` or `(NSString) -> [Int]` | |
* |
An Xcode project generates the following archive:
$ tree Yams-macosx.xcarchive
Yams-macosx.xcarchive
├── Info.plist
├── Products
│ └── Library
│ └── Frameworks
│ └── Yams.framework
With the following code:
import SwiftUI
struct ContentView: View {
@State private var showPopover = false
var body: some View {
NavigationView {
extension Array { | |
func parallelMap<T>(transform: (Element) -> T) -> [T] { | |
var result = ContiguousArray<T?>(repeating: nil, count: count) | |
return result.withUnsafeMutableBufferPointer { buffer in | |
DispatchQueue.concurrentPerform(iterations: buffer.count) { idx in | |
buffer[idx] = transform(self[idx]) | |
} | |
return buffer.map { $0! } | |
} | |
} |
import AppKit | |
import Compression | |
import CoreImage | |
import Foundation | |
import Vision | |
// MARK: - Get QR code image from specified path | |
guard CommandLine.arguments.count == 2 else { | |
print("Usage: scan-shc [path-to-qr-image]") |