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
[ | |
["f", "Show next/latest diffs", "setProposedDiffBounds()"], | |
["n", "Next unreviewed file", "nextUnreviewedFile()"], | |
["p", "Previous unreviewed file", "prevUnreviewedFile()"], | |
[null, "Next personally unreviewed file", "nextPersonallyUnreviewedFile()"], | |
[null, "Previous personally unreviewed file", "prevPersonallyUnreviewedFile()"], | |
["shift+n", "Next changed file", "nextChangedFile()"], | |
["shift+p", "Previous changed file", "prevChangedFile()"], | |
[null, "Next visible file", "nextVisibleFile()"], |
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
~/Documents/Xcode/Cloud/docker-caching-test ❯❯❯ docker build -t docker-caching-test . ✘ 130 | |
Sending build context to Docker daemon 15.36kB | |
Step 1/12 : FROM swift:5.1.1-bionic AS build | |
---> f302143d0aa2 | |
Step 2/12 : RUN mkdir -p /root/docker-caching-test | |
---> Using cache | |
---> b2b73d9fbfa2 | |
Step 3/12 : WORKDIR /root/docker-caching-test | |
---> Using cache | |
---> 07aec73023eb |
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 | |
import Logging | |
import NIOConcurrencyHelpers | |
import NIO | |
import Async | |
import Service | |
public protocol CloseableResource: AnyObject { | |
var eventLoop: EventLoop { get } | |
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
public func attributeMarkdownString(_ string: String, defaultAttributes: [NSAttributedString.Key: Any]) -> NSAttributedString { | |
let result = NSMutableAttributedString(string: string, attributes: defaultAttributes) | |
let linkExpression = try! NSRegularExpression(pattern: "\\[([^]]+)\\]\\(([^)]+)\\)") | |
while let linkMatch = linkExpression.firstMatch(in: result.string, range: NSRange(location: 0, length: result.length)) { | |
let linkString = NSMutableAttributedString(attributedString: result.attributedSubstring(from: linkMatch.range(at: 1))) | |
linkString.addAttributes([ | |
.foregroundColor: Appearance.colors.link, | |
.link: result.attributedSubstring(from: linkMatch.range(at: 2)).string, | |
], range: NSRange(location: 0, length: linkString.length)) |
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
extension Collection where Element: FutureType { | |
/// Flattens an array of futures into a future with an array of results. | |
/// - note: the order of the results will match the order of the futures in the input array. | |
public func flatten(on worker: Worker) -> Future<[Element.Expectation]> { | |
let eventLoop = worker.eventLoop | |
// Avoid unnecessary work | |
guard count > 0 else { | |
return eventLoop.newSucceededFuture(result: []) | |
} |
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 FluentPostgreSQL | |
extension QueryBuilder where Result: Model, | |
Result.Database == Database, | |
Database.Query: FluentSQLQuery, | |
Database.QueryField: SQLColumnIdentifier, | |
Database.QueryField: Hashable, | |
Database.QueryData == Dictionary<String, Database.Query.Expression> { | |
public func update<T>(_ keyPath: WritableKeyPath<Result, T>, to value: T) -> Future<Void> where T: Encodable { | |
Database.queryDataSet(Database.queryField(.keyPath(keyPath)), to: value, on: &query) |
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 NIOConcurrencyHelpers | |
import Vapor | |
public protocol CloseableResource: class { | |
var eventLoop: EventLoop { get } | |
var isClosed: Bool { get } | |
func close() | |
} |
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
/* | |
* DO NOT EDIT. | |
* | |
* Generated by the protocol buffer compiler. | |
* Source: echo.proto | |
* | |
*/ | |
/* | |
* Copyright 2018, gRPC Authors All rights reserved. |
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
/* | |
* DO NOT EDIT. | |
* | |
* Generated by the protocol buffer compiler. | |
* Source: Sync/Proto/echo.proto | |
* | |
*/ | |
/* | |
* Copyright 2018, SwiftGRPC Authors All rights reserved. |
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
var photos = Application("Photos"); | |
var al = photos.albums.whose({ name: 'ALBUM_NAME' })[0].get(); | |
photos.add([photos.mediaItems.whose({ filename: 'FILE_NAME.jpg' })[0].get()], { to: al }); | |
// ... |
NewerOlder