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
| import Foundation | |
| public class WeakSet<T: AnyObject>: Sequence, ExpressibleByArrayLiteral, CustomStringConvertible, CustomDebugStringConvertible { | |
| private var objects = NSHashTable<T>.weakObjects() | |
| public init(_ objects: [T]) { | |
| for object in objects { | |
| insert(object) | |
| } |
To provide better shopping experience for Onefill users, we want to support as many shopping site as we can by injecting our JavaScript engine into those sites. However, some of them are using iframe which is outdated HTML tag to implement some forms like payment and signup. And due to security issue JavaScript can’t communicate with iframe unless it’s same domain or it’s your domain. So here is the approach we did to support iframe under iOS web view and so we can communicate with it.
- Xcode: Version 8.2.1 (8C1002)
- Swift: Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
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
| COMPACT WIDTH (stacked view) | |
| - 320 x 568 pt | |
| -> iPhone 5, 5s | |
| - 320 x 768 pt | |
| -> iPad 9.7" Split Landscape 2/3 right | |
| - 320 x 834 pt | |
| -> iPad 10.5" Split Landscape 2/3 right | |
| - 320 x 1024 pt | |
| -> iPad 9.7" Split Portrait right |
$ strings /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/sourcekitd.framework/Versions/Current/XPCServices/SourceKitService.xpc/Contents/MacOS/SourceKitService|grep source.lang.swift
source.lang.swift.keyword
source.lang.swift.pattern
source.lang.swift.syntaxtype.argument
source.lang.swift.syntaxtype.parameter
source.lang.swift.attribute.availability
source.lang.swift.decl.extension
source.lang.swift.decl.var.parameter
source.lang.swift.stmt.brace
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
| // Set operations taken from | |
| // https://en.wikipedia.org/wiki/Set_(mathematics) | |
| import Foundation | |
| // The empty set | |
| let Ø = NSSet() | |
| // The "Universal" set | |
| let U = NSMutableSet() |
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"?> | |
| <set xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <rotate | |
| android:duration="70" | |
| android:fromDegrees="-5" | |
| android:pivotX="50%" | |
| android:pivotY="50%" | |
| android:repeatCount="5" | |
| android:repeatMode="reverse" |
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
| defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.3;}' |
- You can store a price in a floating point variable.
- All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
- All currencies are subdivided in decimal units (like dinar/fils)
- All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
- All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
- Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
- For any currency you can have a price of 1. (ZWL)
- Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)