- www.haiku-os.org / www.mobileinteraction.se
- @konrad1977
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
--recurse | |
--exclude=.git | |
--exclude=venv | |
--exclude=Pods | |
--exclude=Carthage | |
--exclude=vendor | |
--exclude=node_modules |
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
;; -*- mode: emacs-lisp; lexical-binding: t -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Layer configuration: | |
This function should only modify configuration layer settings." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory | |
;; `+distribution'. For now available distributions are `spacemacs-base' |
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 XCTest | |
// MARK: Comparable --- | |
@discardableResult | |
public func assertGreaterThan<A: Comparable>(_ lhs: A, _ rhs: A) -> String { | |
return lhs > rhs ? "✅" : "❌" | |
} | |
@discardableResult | |
public func assertGreaterThanOrEqual<A: Comparable>(_ lhs: A, _ rhs: A) -> String { |
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 Kitura | |
let router = Router() router.get("/") { request, response, next in | |
response.send("Hello, World!") | |
next() | |
} | |
Kitura.addHTTPServer(onPort: 8090, with: router) | |
Kitura.run() |
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
void UpdatePersonWithId(int personId) { | |
Person personToFind = FindPersonWithId(personId); | |
if (personToFind != null) | |
SavePerson(personToFind); | |
} | |
void FindPersonWithId(int personId) { | |
Person personToFind = null; | |
foreach(person in personList) { | |
if (person.id == personId) { |
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
void UpdatePersonWithId(int personId) { | |
Person personToFind = null; | |
foreach(person in personList) { | |
if (person.id == personId) { | |
personToFind = person; | |
break; | |
} | |
} | |
SavePerson(personToFind); | |
} |
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
class TableViewContorllerThatWorks: UITableViewController { | |
override init(style: UITableViewStyle) { | |
super.init(style: style) | |
} | |
required init(coder aDecoder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
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
protocol AgeClasificationProtocol { | |
var age: Int { get } | |
func agetype() -> String | |
} | |
class Person { | |
let firstname: String | |
let lastname: String | |
var age: Int | |
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
func login() { | |
do { | |
let token = try loginUserWithUsername("konrad1977", password: nil) | |
print("user logged in \(token)") | |
} catch let error as LoginError { | |
print(error.description) | |
} catch { | |
print(error) | |
} |
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 LoginError : CustomStringConvertible { | |
var description: String { | |
switch self { | |
case .EmptyUsername: | |
return "Username cannot be empty" | |
case .EmptyPassword: | |
return "Password cannot be empty" | |
} | |
} |
NewerOlder