(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/** | |
* WkHtmlToPdf table splitting hack. | |
* | |
* Script to automatically split multiple-pages-spanning HTML tables for PDF | |
* generation using webkit. | |
* | |
* To use, you must adjust pdfPage object's contents to reflect your PDF's | |
* page format. | |
* The tables you want to be automatically splitted when the page ends must | |
* have a class name of "splitForPrint" (can be changed). |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
{{$guid}} | |
the above variable will generate UUID in Postman Rest Client | |
Sample request is below | |
======================== | |
{ | |
"user":{ | |
"id":"{{$guid}}" | |
} | |
import Foundation | |
import XCPlayground | |
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true | |
extension NSData { | |
func castToCPointer<T>() -> T { | |
let mem = UnsafeMutablePointer<T>.alloc(sizeof(T.Type)) | |
self.getBytes(mem, length: sizeof(T.Type)) | |
return mem.move() |
import UIKit | |
extension UICollectionReusableView { | |
/// The default implementation of `defaultIdentifier()` uses `NSStringFromClass(class)` rather than `String(class)` so that the module name is includded. | |
/// The hope being that this makes collisions unlikely making it unnnecessary to provide your own implementations. | |
public class func defaultIdentifier() -> String { | |
return NSStringFromClass(self) | |
} | |
} |
#!/usr/bin/env bash | |
# shellcheck disable=SC2155 | |
## Copyright (C) 2017, Oleksandr Kucherenko | |
## Last revisit: 2023-09-30 | |
## Version: 2.0.2 | |
## License: MIT | |
## Fix: 2023-10-01, prefix for initial INIT_VERSION was not applied | |
## Fix: 2023-10-01, correct extraction of latest tag that match version pattern | |
## Added: 2023-09-30, @mrares prefix modification implemented |
Author: Chris Lattner
import Cocoa | |
import CoreMediaIO | |
import AVFoundation | |
class ViewController: NSViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
var prop = CMIOObjectPropertyAddress( | |
mSelector: CMIOObjectPropertySelector(kCMIOHardwarePropertyAllowScreenCaptureDevices), |
For testing purposes, we may want to have local testing servers using self-signed SSL certificate for HTTPS connection. Now, suppose we have a local server with self-signed certificate, establishing an actual HTTPS connection would require us to trust our self-signed certificate. It is easy on a browser: few clicks, and you will be on your way. But how about a Swift application?
Caution: Get an actual, trusted, signed certicate for production apps!
App Transport Security (ATS) is a technology that requires an app to either support best practice HTTPS security or statically declare its security limitations via a property in its
Info.plist
.