Instructure
HackWeek
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<Bucket | |
type = "2" | |
version = "2.0"> | |
<Breakpoints> | |
<!-- All Exceptions --> | |
<BreakpointProxy | |
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> | |
<BreakpointContent |
This file contains 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
public class Channel<Value> { | |
private class Subscription { | |
weak var object: AnyObject? | |
private let notifyBlock: (Value) -> Void | |
private let queue: DispatchQueue | |
var isValid: Bool { | |
return object != nil | |
} |
This file contains 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
// | |
// AppDelegate.swift | |
// Scheduling | |
// | |
// Created by Shaps Benkau on 19/02/2018. | |
// Copyright © 2018 152percent Ltd. All rights reserved. | |
// | |
import UIKit |
This file contains 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
// | |
// Rewrited from Swift to obj-c | |
// Original source: https://github.com/objcio/app-architecture/blob/master/One-App-Eight-Architectures/MultiPattern/KeyboardSizedView.swift | |
// | |
@interface KeyboardSizedView () | |
@property (nonatomic, strong) NSLayoutConstraint *keyboardConstraint; | |
@end |
This file contains 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
// # Challenge2 | |
struct TestCase { | |
let nums: [Int] | |
let expectation: Int | |
} | |
let test1 = [3, 1, 2, 3] // => output: 9 | ok | |
/** | |
3, 3 => 3 |
This file contains 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
extension XCUIApplication { | |
private struct Constants { | |
// Half way accross the screen and 10% from top | |
static let topOffset = CGVector(dx: 0.5, dy: 0.1) | |
// Half way accross the screen and 90% from top | |
static let bottomOffset = CGVector(dx: 0.5, dy: 0.9) | |
} | |
var screenTopCoordinate: XCUICoordinate { |
This file contains 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 Foundation | |
public enum Method: String { | |
case GET | |
case POST | |
case PUT | |
case PATCH | |
case DELETE | |
} |
This file contains 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 Foundation | |
@dynamicMemberLookup | |
final class DynamicUserDefaults { | |
static var standard: DynamicUserDefaults { | |
return DynamicUserDefaults(.standard) | |
} | |
private let keys = Keys() |
This file contains 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 Foundation | |
struct AnyEquatable { | |
private let isEqualTo: (Any) -> Bool | |
let value: Any | |
init<A: Equatable>(_ value: A) { | |
self.value = value | |
isEqualTo = { other in | |
guard let o = other as? A else { return false } |
OlderNewer