This file contains hidden or 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 json | |
| import os | |
| import openai | |
| openai.organization = os.environ.get("OPENAI_ORGANIZATION") | |
| openai.api_key = os.environ.get("OPENAI_API_KEY") | |
| langs = ['fr'] |
This file contains hidden or 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 AVKit | |
| struct ContentView: View { | |
| @State var soundLabelIsShows = false | |
| var body: some View { | |
| ZStack(alignment: .center) { | |
| Image("kane") | |
| .resizable() |
This file contains hidden or 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 Combine | |
| struct SearchView: View { | |
| @StateObject var observer = SearchTextObserver() | |
| var body: some View { | |
| VStack { | |
| TextField("TextField", text: $observer.searchText) | |
| .onChange(of: observer.throttleText) { text in | |
| print("Call API with \(text)") |
This file contains hidden or 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
| struct SearchView: View { | |
| @State var text: String | |
| @FocusState var focused: Bool | |
| @Async<[Item]> var async | |
| var body: some View { | |
| VStack { | |
| TextField("Placeholder", text: $text) | |
| .focused($focused) | |
| .onSubmit { |
This file contains hidden or 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 'dart:math'; | |
| void main() async { | |
| print(_randomEmoji()); | |
| } | |
| String _randomEmoji() { | |
| final emojis = _emojis(); | |
| return emojis[Random().nextInt(emojis.length - 1)]; | |
| } |
This file contains hidden or 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 | |
| struct ToDo : Identifiable, Equatable { | |
| let id: UUID | |
| var title: String | |
| var done: Bool | |
| } | |
| let id = UUID() | |
| let todo = ToDo(id: id, title: "value1", done: false) |
This file contains hidden or 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
| generates: | |
| types.ts: | |
| plugins: | |
| - typescript | |
| - typescript-operations |
This file contains hidden or 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
| { | |
| "sourcekit-lsp.serverPath": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp", | |
| "sourcekit-lsp.serverArguments": [ | |
| "-Xswiftc", | |
| "-sdk", | |
| "-Xswiftc", | |
| "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk", | |
| "-Xswiftc", | |
| "-target", | |
| "-Xswiftc", |
This file contains hidden or 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
| typealias InputAndExpected = [String: String] | |
| let x: InputAndExpected = [ | |
| "11": "11.0", | |
| "11.0": "11.0", | |
| "11.01": "11.01", | |
| "11.1": "11.1", | |
| "11.10": "11.10", | |
| "11.11": "11.11" | |
| ] |