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 Person { | |
let age: Int | |
let name: String | |
let hobbies: [String] | |
// Main initializer that takes all parameters directly and assigns values to (initializes) all properties above | |
init(name: String, age: Int, hobbies: [String]) { | |
self.name = name | |
self.age = age |
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 ContentView: View { | |
var body: some View { | |
TaskList(tasks: [ | |
Task(id: 1, title: "Task 1", isCompleted: false), | |
Task(id: 2, title: "Task 2", isCompleted: false), | |
Task(id: 3, title: "Task 3", isCompleted: 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
struct SelectHabitsView: View { | |
@State private var selectedHabits: Set<String> = [] | |
let habits = ["H1", "H2", "H3"] | |
var body: some View { | |
List { | |
ForEach(habits, id: \.self) { habit in | |
HabitView( |
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 UIKit | |
class CustomURLProtocol: URLProtocol { | |
struct Constants { | |
static let RequestHandledKey = "URLProtocolRequestHandled" | |
} | |
var session: URLSession? | |
var sessionTask: URLSessionDataTask? |
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
{ | |
"name": "box2d", | |
"license": { | |
"type": "zlib" | |
}, | |
"version": "2.3.0", | |
"summary": "Box2D is an open source C++ engine for simulating rigid bodies in 2D.", | |
"description": "Box2D is an open source C++ engine for simulating rigid bodies in 2D. Box2D is developed by Erin Catto and has the zlib license. While the zlib license does not require acknowledgement, we encourage you to give credit to Box2D in your product.", | |
"homepage": "http://www.cocos2d-iphone.org", | |
"authors": "Erin Catto", |
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
<? | |
function createDivision($divSize) { | |
$matches = array(); | |
for($i=1; $i<=$divSize/2; $i++) { | |
$j = $divSize-$i + 1; | |
$matches[] = [$i,$j]; | |
} | |
return $matches; |
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
// Photoshop Script to Create iPhone Icons from iTunesArtwork | |
// | |
// WARNING!!! In the rare case that there are name collisions, this script will | |
// overwrite (delete perminently) files in the same folder in which the selected | |
// iTunesArtwork file is located. Therefore, to be safe, before running the | |
// script, it's best to make sure the selected iTuensArtwork file is the only | |
// file in its containing folder. | |
// | |
// Copyright (c) 2010 Matt Di Pasquale | |
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com |