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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>django.core.exceptions.ValidationError: ['No data returned!'] // Werkzeug Debugger</title> | |
<link rel="stylesheet" href="?__debugger__=yes&cmd=resource&f=style.css" | |
type="text/css"> | |
<!-- We need to make sure this has a favicon so that the debugger does | |
not accidentally trigger a request to /favicon.ico which might | |
change the application's state. --> |
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
{"AAPL":{"logo":{"url":"https://storage.googleapis.com/iexcloud-hl37opg/api/logos/AAPL.png"},"quote":{"symbol":"AAPL","companyName":"Apple, Inc.","primaryExchange":"NASDAQ","calculationPrice":"close","open":116.07,"openTime":1603200601220,"openSource":"official","close":117.51,"closeTime":1603224000705,"closeSource":"official","high":118.98,"highTime":1603238395210,"highSource":"15 minute delayed price","low":115.63,"lowTime":1603201026194,"lowSource":"15 minute delayed price","latestPrice":117.51,"latestSource":"Close","latestTime":"October 20, 2020","latestUpdate":1603224000705,"latestVolume":123867223,"iexRealtimePrice":117.41,"iexRealtimeSize":90,"iexLastUpdated":1603227094136,"delayedPrice":117.17,"delayedPriceTime":1603269926945,"oddLotDelayedPrice":117.49,"oddLotDelayedPriceTime":1603223999479,"extendedPrice":null,"extendedChange":null,"extendedChangePercent":0,"extendedPriceTime":null,"previousClose":115.98,"previousVolume":120639337,"change":1.53,"changePercent":1.319,"volume":0,"iexMarketPercent":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
struct ContentView: View { | |
var body: some View { | |
TabView() { | |
Text("Hello") | |
.onAppear { | |
print("multiple times called") | |
} | |
Text("Other") | |
} |
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 CoreData | |
struct RandomView: View { | |
var body: some View { | |
Text("Hi") | |
.onAppear { | |
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(1)) { | |
doSomething() | |
} |
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 MyView: View { | |
@State var name = "" | |
init(..., name: String = "") { | |
self.name = name // Error | |
// In some cases i want to provide a name and assign it to my @State. | |
} | |
var body: some View { |
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 Combine | |
var cancellables = Set<AnyCancellable>() | |
let test = [1, 2, 3, 4].publisher | |
.delay(for: .seconds(2), scheduler: DispatchQueue.global()) | |
.print() | |
.share() | |
test.sink { value in |
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
func randomNum() -> AnyPublisher<Int, Never> { | |
return AnyPublisher<Int, Never> { seed in | |
seed.success(Int.random(in: 1...10)) | |
} | |
} |
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
func arrayWith(n: Int, k : Int) -> [Int] { | |
let elements = (1...n).map { $0 } // We only allow 1,2,3.... till n | |
var output = [Int]() | |
repeat { | |
output.removeAll() | |
for _ in 0..<n { | |
let validNumbers = elements.filter { $0 + output.reduce(0,+) <= k } | |
if let random = validNumbers.randomElement() { | |
output.append(random) | |
} else { |
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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
import SwiftUI | |
import Combine | |
import SwiftUI |
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 | |
extension View { | |
func badge(num: Int) -> some View { | |
return self.overlay( | |
ZStack(alignment: .topTrailing) { | |
Circle() | |
.fill(Color.red) | |
.frame(width: 24, height: 24) |
NewerOlder