Following instructions from the excellent https://www.rinkeby.io/
A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well,
| //Safe bounds check for Array | |
| //http://stackoverflow.com/questions/25329186/safe-bounds-checked-array-lookup-in-swift-through-optional-bindings | |
| extension Collection { | |
| /// Returns the element at the specified index iff it is within bounds, otherwise nil. | |
| subscript (safe index: Index) -> Iterator.Element? { | |
| return index >= startIndex && index < endIndex ? self[index] : nil | |
| } | |
| } | |
| //Helper function to exchange position in one array |
| func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String { | |
| let calendar = NSCalendar.currentCalendar() | |
| let now = NSDate() | |
| let earliest = now.earlierDate(date) | |
| let latest = (earliest == now) ? date : now | |
| let components:NSDateComponents = calendar.components([NSCalendarUnit.Minute , NSCalendarUnit.Hour , NSCalendarUnit.Day , NSCalendarUnit.WeekOfYear , NSCalendarUnit.Month , NSCalendarUnit.Year , NSCalendarUnit.Second], fromDate: earliest, toDate: latest, options: NSCalendarOptions()) | |
| if (components.year >= 2) { | |
| return "\(components.year) years ago" | |
| } else if (components.year >= 1){ |
| import ahocorasick as ahc | |
| keywords = [ | |
| ('he', 1), | |
| ('she', 1), | |
| ('hers', 1), | |
| ('her', 1) | |
| ] | |
| text = [ |
| // | |
| // debounce-throttle.swift | |
| // | |
| // Created by Simon Ljungberg on 19/12/16. | |
| // License: MIT | |
| // | |
| import Foundation | |
| extension TimeInterval { |
Following instructions from the excellent https://www.rinkeby.io/
A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well,
| .ReactTable { | |
| position: relative; | |
| display: -webkit-box; | |
| display: -ms-flexbox; | |
| display: flex; | |
| -webkit-box-orient: vertical; | |
| -webkit-box-direction: normal; | |
| -ms-flex-direction: column; | |
| flex-direction: column; | |
| border: 1px solid rgba(0, 0, 0, 0.1); |
| // | |
| // Created by はるふ on 2017/12/11. | |
| // Copyright © 2017年 ha1f. All rights reserved. | |
| // | |
| import Foundation | |
| import CoreImage | |
| import AVFoundation | |
| extension CIFilter { |
| // | |
| // Created by はるふ on 2017/12/11. | |
| // Copyright © 2017年 ha1f. All rights reserved. | |
| // | |
| import Foundation | |
| import CoreImage | |
| import AVFoundation | |
| extension CIFilter { |
| // Authoer: The SwiftUI Lab | |
| // Full article: https://swiftui-lab.com/scrollview-pull-to-refresh/ | |
| import SwiftUI | |
| struct RefreshableScrollView<Content: View>: View { | |
| @State private var previousScrollOffset: CGFloat = 0 | |
| @State private var scrollOffset: CGFloat = 0 | |
| @State private var frozen: Bool = false | |
| @State private var rotation: Angle = .degrees(0) |