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 Javascript core | |
import JavaScriptCore | |
//[...] | |
//Get the JS Context | |
let context = JSContext()! | |
//write your function in javascript and feed it to context | |
context.evaluateScript(#""" |
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 LeafKit | |
final class JSONifyTag: UnsafeUnescapedLeafTag { | |
func render(_ ctx: LeafContext) throws -> LeafData { | |
guard let param = ctx.parameters.first else { | |
throw "no parameter provided to JSONify" | |
} | |
return LeafData.string(param.jsonString) | |
} |
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 Foundation | |
import Fluent | |
protocol DynamicQueryable { | |
static func dynamicMapping<DB: Database, QB: QueryBuilder<DB, Self>>() -> [String: (DynamicFilter, QB) throws -> QB] | |
} | |
protocol DynamicSortable { | |
static var dynamicFieldMapping: [String: FluentProperty] { get } | |
} |
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 Foundation | |
import Combine | |
import SwiftUI | |
import FuncNetworking | |
import AddaMeModels | |
import KeychainService | |
import InfoPlist | |
public struct WebsocketClient { |
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 Foundation | |
import SwiftUI | |
#if canImport(UIKit) | |
import UIKit | |
#elseif canImport(AppKit) | |
import AppKit | |
#endif | |
extension Image { | |
/// Initializes a SwiftUI `Image` from data. |
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
#!/usr/bin/swift | |
import Foundation | |
// MARK: - Script variables | |
let awsProfileName: String? = "myProfile" | |
let serviceName = "someService" | |
// MARK: - Functions | |
@discardableResult | |
func shell(_ args: String..., returnStdOut: Bool = false, stdIn: Pipe? = nil) -> (Int32, Pipe) { |
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 Vapor | |
import IkigaJSON | |
extension IkigaJSONEncoder: ContentEncoder { | |
public func encode<E: Encodable>( | |
_ encodable: E, | |
to body: inout ByteBuffer, | |
headers: inout HTTPHeaders | |
) throws { | |
headers.contentType = .json |
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
// | |
// ContentView.swift | |
// | |
// | |
// Created by Bernstein, Joel on 7/4/20. | |
// | |
import SwiftUI | |
struct ElementModel: Identifiable |
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 Desktop: View { | |
var body: some View { | |
ZStack { | |
// Image(uiImage: #imageLiteral(resourceName: "IMG_6281.JPG")) | |
Color(UIColor.systemBlue) | |
macOS() | |
} |
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()) |
NewerOlder