OpenCV -> UIImage
cv::Mat mat /* = ... */;
UIImage* image = [UIImage fromCvMat:mat];
UIImage -> OpenCV
#!/bin/sh | |
# | |
# sort a "du" listing by directory size | |
# usage: du | dusort | |
FILES= | |
TFORM=0 | |
while test $# -ge 1; do | |
case $1 in | |
-t) TFORM=1; ;; |
import CryptoSwift | |
import Foundation | |
// Combined from https://github.com/lachlanbell/SwiftOTP/blob/master/SwiftOTP/Generator.swift and https://raw.githubusercontent.com/vapor/open-crypto/3.3.3/Sources/Crypto/MAC/OTP.swift | |
// MARK: TOTP | |
/// Generates Time-based One-time Passwords using HMAC. | |
/// |
OpenCV -> UIImage
cv::Mat mat /* = ... */;
UIImage* image = [UIImage fromCvMat:mat];
UIImage -> OpenCV
extension BoardCollectionViewCell: UITableViewDropDelegate { | |
func tableView(_ tableView: UITableView, performDropWith coordinator: UITableViewDropCoordinator) { | |
if coordinator.session.hasItemsConforming(toTypeIdentifiers: [kUTTypePlainText as String]) { | |
coordinator.session.loadObjects(ofClass: NSString.self) { (items) in | |
guard let string = items.first as? String else { | |
return | |
} | |
var updatedIndexPaths = [IndexPath]() | |
One file for each domain, both www.example.com and example.com need separate files:
{
"applinks": {
"apps": [],
"details": {
"9JA89QQLNQ.com.apple.wwdc": {
osascript -e 'tell application "iOS Simulator" to quit' | |
osascript -e 'tell application "Simulator" to quit' | |
xcrun simctl erase all |
defaults write xcodebuild PBXNumberOfParallelBuildSubtasks 4 | |
defaults write xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4 | |
defaults write com.apple.xcode PBXNumberOfParallelBuildSubtasks 4 | |
defaults write com.apple.xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4 |
import RealmSwift | |
import Realm | |
protocol CascadeDeleting: class { | |
func delete<Entity>(_ list: List<Entity>, cascading: Bool) | |
func delete<Entity>(_ results: Results<Entity>, cascading: Bool) | |
func delete<Entity: Object>(_ entity: Entity, cascading: Bool) | |
} |
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
import AsyncDisplayKit | |
class DashboardNode: ASDisplayNode { | |
private let collectionNode: ASCollectionNode | |
init() { | |
let collectionFlow = UICollectionViewFlowLayout() | |
collectionNode = ASCollectionNode(collectionViewLayout: collectionFlow) | |
super.init() |