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
interface OnModelChangeListener { | |
fun onModelChangeName(model: Model, name: String) | |
} | |
class Model { | |
var name = "" | |
set(value) { | |
field = value | |
publishChangedName(value) | |
} |
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
class Node { | |
var left, right: Node? | |
var data: Int | |
init(data: Int, left: Node? = nil, right: Node? = nil) { | |
self.data = data | |
self.left = left | |
self.right = right | |
} | |
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
func addChildView(_ childView: UIView, to containerView: UIView) { | |
containerView.addSubview(childView) | |
childView.translatesAutoresizingMaskIntoConstraints = false | |
NSLayoutConstraint(item: childView, | |
attribute: .leading, | |
relatedBy: .equal, | |
toItem: containerView, | |
attribute: .leading, | |
multiplier: 1.0, |
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
router := httprouter.New() | |
router.POST("/api/login", httpHandler(login)) | |
func httpHandler(fn httpRouterFunc) httpRouterFunc { | |
return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { | |
fn(w, r, ps) | |
} | |
} | |
func login(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { |
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
enum Result<T> { | |
case value(T) | |
case error(Error) | |
} | |
final class Future<T> { | |
private let queue: DispatchQueue | |
private var callbacks: [(Result<T>) -> ()] = [] | |
private var result: Result<T>? | |
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
// | |
// Networker.swift | |
// SES Admin | |
// | |
// Created by Miguel Fermin on 8/03/18. | |
// Updated by Miguel Fermin on 8/22/18. | |
// Copyright © 2018 MAF Software LLC. All rights reserved. | |
// | |
import Foundation |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>DVTConsoleDebuggerInputTextColor</key> | |
<string>0 0 0 1</string> | |
<key>DVTConsoleDebuggerInputTextFont</key> | |
<string>Hack-Bold - 13.0</string> | |
<key>DVTConsoleDebuggerOutputTextColor</key> | |
<string>0 0 0 1</string> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>DVTConsoleDebuggerInputTextColor</key> | |
<string>0.901961 0.901961 0.901961 1</string> | |
<key>DVTConsoleDebuggerInputTextFont</key> | |
<string>SFMono-Regular - 10.0</string> | |
<key>DVTConsoleDebuggerOutputTextColor</key> | |
<string>0.901961 0.901961 0.901961 1</string> |
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
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
r := unscrambleable("hello", "llohe") | |
fmt.Println("is unscrambleable? ", r) | |
} |
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
// Writing Web Applications: | |
// | |
// - Creating a data structure with load and save methods | |
// - Using the net/http package to build web applications | |
// - Using the html/template package to process HTML templates | |
// - Using the regexp package to validate user input | |
// - Using closures | |
// | |
// - Link: https://golang.org/doc/articles/wiki/ |
NewerOlder