Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@interface UIView (LayoutConvenience) | |
- (NSLayoutConstraint *)constraintAligningAttribute:(NSLayoutAttribute)attr withView:(UIView *)otherView; | |
@end | |
@implementation UIView (LayoutConvenience) | |
- (NSLayoutConstraint *)constraintAligningAttribute:(NSLayoutAttribute)attr withView:(UIView *)otherView { | |
return [NSLayoutConstraint constraintWithItem:self attribute:attr relatedBy:NSLayoutRelationEqual toItem:otherView attribute:attr multiplier:1.0 constant:0.0]; | |
} | |
@end |
#!/bin/sh | |
# First, set the width/height DPI on the file | |
sips -s dpiWidth 144 -s dpiHeight 144 "$1" | |
# Fake that it is a screen capture (wat?) | |
xattr -wx com.apple.metadata:kMDItemIsScreenCapture "62 70 6C 69 73 74 30 30 09 08 00 00 00 00 00 00 01 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09" "$1" | |
xattr -wx com.apple.metadata:kMDItemScreenCaptureType "62 70 6C 69 73 74 30 30 59 73 65 6C 65 63 74 69 6F 6E 08 00 00 00 00 00 00 01 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12" "$1" | |
xattr -wx com.apple.FinderInfo "00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" "$1" |
sudo install_name_tool -add_rpath @executable_path/../lib/swift/macosx /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-03-16-a.xctoolchain/usr/bin/swift-build | |
sudo install_name_tool -add_rpath @executable_path/../lib/swift/macosx /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-03-16-a.xctoolchain/usr/bin/swift-test |
// 1. Implement URLSession:task:didReceiveChallenge:completionHandler:. (Be sure to call the completion handler with NSURLSessionAuthChallengeDisposition.PerformDefaultHandling and a nil NSURLCredential.) | |
// 2. Set a breakpoint in the callback + trigger an authentication challenge at runtime | |
// 3. In the debugger, inspect the callback's `challenge.protectionSpace` argument for the values to put in the following lines of code... | |
// 4. Put the following lines of code somewhere before your network requests (i.e. AppDelegate area, or other) | |
let basicAuthCredentials = NSURLCredential(user: "username", password: "password", persistence: .Permanent) | |
let foobarHttpsProtectionSpace = NSURLProtectionSpace(host: "foo.bar.com", port: 443, protocol: "https", realm: "This Probably Has A Value, Get It From The Delegate Callback", authenticationMethod: NSURLAuthenticationMethodHTTPBasic) | |
NSURLCredentialStorage.sharedCredentialStorage().setDefaultCredential(basicAuthCredentials, forProtectionSpace: apidevHttpsProtectionSpace |
import Fluent | |
func fetchChildren<Parent, ParentID, Child: Model, Result>( | |
of parents: [Parent], | |
idKey: KeyPath<Parent, ParentID?>, | |
via reference: KeyPath<Child, ParentID>, | |
on conn: DatabaseConnectable, | |
combining: @escaping (Parent, [Child]) -> Result) -> Future<[Result]> where ParentID: Hashable & Encodable { | |
let parentIDs = parents.compactMap { $0[keyPath: idKey] } | |
let children = Child.query(on: conn) |
Worth a read for some more context.
Create the file in the root of the project (where your Package.swift
file lives as well), and use the following contents:
/// Package.xcconfig