rbenv install -l
rbenv install 2.6.5
rbenv local 2.6.5
gem install bundler
bundle install
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 | |
import Alamofire | |
import RxSwift | |
extension Reactive where Base: SessionManager { | |
func encodeMultipartUpload(to url: URLConvertible, method: HTTPMethod = .post, headers: HTTPHeaders = [:], data: @escaping (MultipartFormData) -> Void) -> Observable<UploadRequest> { | |
return Observable.create { observer in | |
self.base.upload(multipartFormData: data, | |
to: url, | |
method: method, |
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 Dao { | |
func insert(key: String, value: Any) -> Bool | |
func find(key: String) -> Any? | |
} | |
protocol StoreAdapterFactory { | |
func create() -> Dao | |
} | |
class StoreMemoryAdapter : Dao { |
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 android.content.ContentUris | |
import android.content.Context | |
import android.database.Cursor | |
import android.net.Uri | |
import android.os.Build | |
import android.os.Environment | |
import android.provider.DocumentsContract | |
import android.provider.MediaStore | |
import android.support.v4.content.CursorLoader | |
import android.text.TextUtils |
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
// | |
// MazeViewController.swift | |
// | |
import UIKit | |
import Foundation | |
import RxSwift | |
class MazeViewController: UIViewController { | |
var currentDisposable: Disposable? = 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
import android.content.Context; | |
import android.location.Address; | |
import android.location.Geocoder; | |
import java.io.IOException; | |
import rx.Observable; | |
import rx.Subscriber; | |
import rx.android.schedulers.AndroidSchedulers; | |
import rx.schedulers.Schedulers; |
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
package com.github.manuelpeinado.toolbartest; | |
import android.graphics.Color; | |
import android.graphics.drawable.Drawable; | |
import android.os.Bundle; | |
import android.support.v7.app.ActionBarActivity; | |
import android.support.v7.widget.Toolbar; | |
import android.view.Menu; | |
import android.view.View; |
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 convertSpecialCharacters(string: String) -> String { | |
var newString = string | |
var char_dictionary = [ | |
"&": "&", | |
"<": "<", | |
">": ">", | |
""": "\"", | |
"'": "'" | |
]; | |
for (escaped_char, unescaped_char) in char_dictionary { |
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
//https://developer.apple.com/library/content/samplecode/TableSearch_UISearchController/Introduction/Intro.html | |
// MARK: - UISearchResultsUpdating | |
func updateSearchResults(for searchController: UISearchController) { | |
// Update the filtered array based on the search text. | |
let searchResults = products | |
// Strip out all the leading and trailing spaces. | |
let whitespaceCharacterSet = CharacterSet.whitespaces |
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
// Model | |
import Foundation | |
class Post: Codable { | |
var id = 0 | |
var userId = 0 | |
var title = "" | |
var body = "" | |
} |
OlderNewer