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 SwiftUI | |
import PlaygroundSupport | |
struct ContentView: View { | |
var body: some View { | |
Text("Hello World") | |
} | |
} | |
PlaygroundPage.current.setLiveView(ContentView()) |
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 SwiftUI | |
import DJISDK | |
struct ContentView: View { | |
var body: some View { | |
Text("DJI SDK Version: \(DJISDKManager.sdkVersion())") | |
.padding() | |
} | |
} |
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
// Blogged at http://design.featherless.software/enumerate-midipacketlist-in-swift-part-1/ | |
// and http://design.featherless.software/enumerate-midipacketlist-in-swift-part-2/ | |
extension MIDIPacketList: SequenceType { | |
public func generate() -> AnyGenerator<MIDIPacket> { | |
var iterator: MIDIPacket? | |
var nextIndex: UInt32 = 0 | |
return anyGenerator { | |
if nextIndex++ >= self.numPackets { return nil } | |
if iterator != nil { |
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 pulumi | |
import pulumi_docker as docker | |
myapp_build = docker.DockerBuild(context=f'../flask-first-steps') | |
myapp_image = docker.Image("myapp_image", image_name='myapp', build=myapp_build, skip_push=True) | |
container_ports = docker.ContainerPortArgs(internal=80, external=8080) | |
myapp_container = docker.Container("myapp_container", image="myapp", ports=[container_ports]) |
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 SwiftUI | |
import Network | |
struct ContentView: View { | |
@State var connection: NWConnection? | |
var host: NWEndpoint.Host = "127.0.0.1" | |
var port: NWEndpoint.Port = 1234 | |
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 SwiftUI | |
import os.log | |
@main | |
struct MyApp: App { | |
private let logger = Logger(subsystem: "bundleId", category: "classname") | |
@Environment(\.scenePhase) private var scenePhase | |
var body: some Scene { |
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 Combine | |
import CoreMotion | |
import Foundation | |
class MotionPublisher: ObservableObject { | |
@Published var accelerationX: Double = 0.0 | |
@Published var accelerationY: Double = 0.0 | |
@Published var accelerationZ: Double = 0.0 | |