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 | |
| import Foundation | |
| // MARK: - Movie Database | |
| let movies = [ | |
| "The Matrix", | |
| "The Godfather", | |
| "The Dark Knight", | |
| "Monty Python and the Holy Grail", | |
| "Forrest Gump", |
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
| # ======================== | |
| # .gitignore for Xcode 16 | |
| # ======================== | |
| # Tags: Xcode, gitignore, Swift, iOS, macOS, Development | |
| # A comprehensive .gitignore file tailored for Xcode 16 projects. | |
| # Excludes auto-generated, system-specific, and unnecessary files. | |
| # Suitable for Swift, Objective-C, CocoaPods, Carthage, and more. | |
| # --- macOS Files --- | |
| # Ignore system-generated files specific to macOS. |
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 React, { useState, useRef } from 'react'; | |
| import { View, Text, TouchableOpacity, StyleSheet } from 'react-native'; | |
| export default function App() { | |
| // Set up useState and useRef here... | |
| // Constants for formatting time here... | |
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
| # where we do the main work of creating a credit card... | |
| class CreditCard | |
| VALID_TYPES = [ | |
| CreditCardType.new("AMEX", /^3(4|7)\d{13}$/), | |
| CreditCardType.new("DCCB", /^30[0-5]\d{11}$/), | |
| CreditCardType.new("DISC", /^6(011|5\d\d)\d{12}$/), | |
| CreditCardType.new("MC", /^5[1-5]\d{14}$/), | |
| CreditCardType.new("VISA", /^4\d{12}(\d{3})?$/) | |
| ] |
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 Foundation | |
| struct Repository: Decodable { | |
| let name: String | |
| let htmlURL: String | |
| enum CodingKeys : String, CodingKey { | |
| case name | |
| case htmlURL = "html_url" |
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 Foundation | |
| struct Repositories: Decodable { | |
| let repos: [Repository] | |
| enum CodingKeys : String, CodingKey { | |
| case repos = "items" | |
| } | |
| } |
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
| <p><%= @friend.full_name %>,</p> | |
| <p>I had previously listed you as a friend; however, I am reminded of the old Klingon proverb:<br /><br /> | |
| QaghmeylIj tIchID, yIyoH <br /> | |
| <em>(Have the courage to admit your mistakes.)</em><br /> | |
| </p> | |
| <p>Clearly it was a mistake to make you a friend. I admit this error in judgment and hereby remove you from my friend list.</p> |
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
| nuqneH <%= @friend.nickname %>, | |
| I've just listed you as one of my friends. I am sure you are deeply honored, as you should be. | |
| Remember the Klingon proverb regarding friends: | |
| may'Daq jaHDI' SuvwI' juppu'Daj lonbe' | |
| (When a warrior goes to a battle, he does not abandon his friends.) | |
| Don't forget about me when you go into battle -- I will not forget you. |
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
| // One solution to the class exercise | |
| import UIKit | |
| import Combine | |
| import PlaygroundSupport | |
| // This playground will execute indefinetly in order to give our | |
| // async operations enough time to execute. | |
| PlaygroundPage.current.needsIndefiniteExecution = true |
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
| // h/t to @JohnSundell (https://www.swiftbysundell.com/) | |
| import UIKit | |
| import Combine | |
| import PlaygroundSupport | |
| // This playground will execute indefinetly in order to give our | |
| // async operations enough time to execute. | |
| PlaygroundPage.current.needsIndefiniteExecution = true | |
NewerOlder