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
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
These are the file attachments for rdar://31302382.
#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]` | |
* |
# 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
// Example approach for modeling localized strings in Realm | |
import Foundation | |
import RealmSwift | |
enum Locale: String { | |
case English = "en" | |
case French = "fr" | |
} |
//////////////////////////////////////////////////////////////////////////// | |
// | |
// Copyright 2014 Realm Inc. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// |
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./** | |
Although this example demonstrates how to store flat arrays of strings | |
on a Realm model, you can extend this pattern to store anything from | |
arrays of integers to native Swift enum's. Basically anything that you can | |
map to a representable type in Realm. | |
*/ | |
class RealmString : Object { | |
dynamic var stringValue = "" | |
} |
I hereby claim:
To claim this, I am signing this object:
import RealmSwift | |
// Swift's syntax allows for a variety of ways to invoke closures. | |
// Here are some of them, specifically ways to making write transactions in Realm Swift. | |
// See https://realm.io/docs/swift/latest/#writes for Realm's docs on write transactions. | |
do { | |
let realm = try Realm() | |
// 1 |