Skip to content

Instantly share code, notes, and snippets.

View azamsharp's full-sized avatar

Mohammad Azam azamsharp

View GitHub Profile
import UIKit
// Dispatch Groups
func collectAllReviewIds() {
let group = DispatchGroup()
var reviewIds: [Int] = []
//
// ContentView.swift
// GradientsinSwiftUI
//
// Created by Mohammad Azam on 3/2/21.
//
import SwiftUI
struct ContentView: View {
# EXCEPTIONS
# try and except go together
try:
result = 1/2
number = int(input("Enter any number: ")) # e
except ZeroDivisionError:
print("Please don't divide by zero!")
class CustomerListScreen extends StatelessWidget {
final customers = ["Alex", "John", "Bryan", "Jerry", "Mary"];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Customers")
),
class CustomerList extends StatelessWidget {
final List<String> customers;
final Function(String) onSelected;
CustomerList({@required this.customers, this.onSelected});
@override
Widget build(BuildContext context) {
@azamsharp
azamsharp / .dart
Last active February 8, 2021 19:51
class CustomerList extends StatelessWidget {
final List<String> customers;
CustomerList({@required this.customers});
@override
Widget build(BuildContext context) {
return ListView.builder(
class CustomerListScreen extends StatelessWidget {
final customers = ["Alex", "John", "Bryan", "Jerry", "Mary"];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Customers")
),
//
// MainScreen.swift
// IntroductionToSwiftUI-Workshop
//
// Created by Mohammad Azam on 2/6/21.
//
import SwiftUI
class Settings: ObservableObject {
@azamsharp
azamsharp / .py
Last active February 2, 2021 17:12
# Data Types in Python
# String - Combination of alphanumeric characters 33AAA$%^
# Int - Numbers without decimal (whole numbers) 34, 2,1 100, 986
# Float - Numbers with decimal 5.23, 3.142, 5.0
# Bool - YES/NO, TRUE/FALSE, 1/0, ON/OFF
# Variables
name = "John"
age = 34
var body: some View {
NavigationView {
VStack {
// get the selected customer
CustomerListView(customers: customers) { (customer) in
selectedCustomer = customer
}
if let selectedCustomer = selectedCustomer {