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
class Rating extends StatefulWidget { | |
final int maximumRating; | |
Rating([this.maximumRating = 5]); | |
@override | |
_Rating createState() => _Rating(); | |
} |
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
// | |
// ContentView.swift | |
// MobileBankApp | |
// | |
// Created by Mohammad Azam on 10/7/20. | |
// | |
import SwiftUI | |
struct Card: 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
<html> | |
<head> | |
<link rel="stylesheet" href="css/styles.css"> | |
</head> | |
<body> | |
<h1>TODO List</h1> | |
<input type="text" id="taskNameTextBox" /> | |
<button id="saveButton">Save Task</button> |
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
// | |
// ContentView.swift | |
// PlantsApp | |
// | |
// Created by Mohammad Azam on 9/28/20. | |
// | |
import SwiftUI | |
struct ContentView: 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
// Classes in JavaScript | |
function Car(make, model) { | |
this.make = make | |
this.model = model | |
} | |
/* | |
function drive() { | |
console.log("Car is driving") |
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
/* By default Flexbox have flex-direction: row */ | |
/* When FlexBox is row then justify content moves items left/right | |
When FlexBox is column then justify content moves items up/down | |
When FlexBox is row align-items moves up/down | |
When FlexBox is column align-items movies left-right | |
*/ |
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
from datetime import datetime | |
class PoolTable: | |
def __init__(self, table_number): | |
self.table_number = table_number | |
self.start_time = None | |
self.end_time = None | |
self.time_played = None | |
def check_out(self): |
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
// Store.swift | |
typealias ActionCreator = (_ dispatch: @escaping (Action) -> ()) -> () | |
func getMovies() -> ActionCreator { | |
return { dispatch in | |
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { | |
dispatch(.populateMovies([Movie(title: "ABC")])) | |
} |
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 { | |
@State private var rating: Int? | |
var body: some View { | |
VStack { | |
RatingView(rating: $rating, max: 5) | |
Text(rating != nil ? "You rating: \(rating!)" : "") | |
} | |
} |
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
var body: some View { | |
HStack { | |
ForEach(1..<(max + 1), id: \.self) { index in | |
Image(systemName: self.starType(index: index)) | |
.foregroundColor(Color.orange) | |
.onTapGesture { | |
self.rating = index | |
} | |
} | |
} |