Skip to content

Instantly share code, notes, and snippets.

View twof's full-sized avatar
💧

Alex Reilly twof

💧
View GitHub Profile
$ swift build
Updating https://github.com/apple/swift-nio-extras.git
Updating https://github.com/vapor/open-crypto.git
Updating https://github.com/vapor/async-kit.git
Updating https://github.com/vapor/console-kit.git
Updating https://github.com/vapor/fluent-kit.git
Updating https://github.com/vapor/sql-kit.git
Updating https://github.com/apple/swift-nio.git
Updating https://github.com/vapor/vapor.git
Updating https://github.com/vapor/fluent.git
import SwiftUI
import Combine
struct Track: Hashable, Identifiable {
var id: Int
let name: String
var voteScore: Int = 0
var currentVote: VoteDirection = .none
protocol Node {
associatedtype Value: Numeric
func execute() -> Value
}
protocol Operator: Node {
associatedtype LeftNode: Node
associatedtype RightNode: Node
class Gradient extends React.Component {
render() {
// var topColor = this.props.topColor
// var bottomColor = this.props.bottomColor
console.log(typeof this.props.children)
var child = this.props.children
// console.log(child.props.children)
while(typeof child.props.children == 'object') {
console.log(typeof child)
child = child.props.children
[
{
"message": "\u001b[2K\r[1/3] Compiling Swift Module 'RoutingKitTests' (1 sources)\u001b[2K\r\u001b[1m/root/project/Tests/RoutingKitTests/RouterTests.swift:256:5: \u001b[0;1;35mwarning: \u001b[0m\u001b[1mwill never be executed\r\n\u001b[0m print()\r\n\u001b[0;1;32m ^\r\n\u001b[0m\u001b[1m/root/project/Tests/RoutingKitTests/RouterTests.swift:252:11: \u001b[0;1;30mnote: \u001b[0m\u001b[1mcondition always evaluates to false\r\n\u001b[0m guard !_isDebugAssertConfiguration() else {\r\n\u001b[0;1;32m ^\r\n\u001b[0m\u001b[2K\r[2/3] Compiling Swift Module 'routing_kitPackageTests' (1 sources)\u001b[2K\r[3/3] Linking ./.build/x86_64-unknown-linux/debug/routing-kitPackageTests.xctest\r\nTest Suite 'All tests' started at 2019-02-21 02:35:30.698\r\nTest Suite 'debug.xctest' started at 2019-02-21 02:35:30.699\r\nTest Suite 'RouterTests' started at 2019-02-21 02:35:30.699\r\nTest Case 'RouterTests.testRouter' started at 2019-02-21 02:35:30.699\r\nTest Case 'RouterTests.testRouter' passed (0
import Vapor
import Twilio
import Files
struct BasicZorkController {
fileprivate func incomingMessage(req: Request) throws -> Future<Response> {
let sms = try req.content.syncDecode(IncomingSMS.self)
print(sms)
return try run(command: sms.body, phoneNumber: sms.from, on: req).map { output in
template<typename... Extensions>
auto with_extension(WaylandExtensions const& wayland_extensions,
std::string const& name, std::function<std::shared_ptr<void>(wl_display*)> builder, // This line contains two function arguments, where the others have one. This makes it harder to quickly visually scan down the argument list
Extensions... extensions) -> WaylandExtensions // This line and the one below it are one space behind the inidentation level of the function argument above it. Also shares this line with the return type
{
return with_extension(with_extension(wayland_extensions, name, builder), extensions...);
}
// suggestion
template<typename... Extensions>
template<typename Policy, typename ...Args>
auto set_window_management_policy(Args& ... args) -> SetWindowManagementPolicy
{
return SetWindowManagementPolicy{[&args...](WindowManagerTools const& tools) -> std::unique_ptr<WindowManagementPolicy>
{ return std::make_unique<Policy>(tools, args...); }};
}
}
func processEventMessage( req: Request, e: EventMessage) throws -> Future<EventResponse> {
let logger = try req.make(Logger.self)
logger.debug("This is the event to process: (e)")
guard let sessionStatus = e.sessionStatus else {
logger.info("Unable to parse metadata for (e)")
throw EventReceiveError.CouldNotDecodeMetadata(event: e)
}
let eventUUID = e.uuid
let eventName = sessionStatus.name
let projectID = sessionStatus.projectID
$ vapor xcode
Generating Xcode Project [Failed]
https://github.com/apple/swift-nio.git @ master: error: manifest parse error(s):
/var/folders/hj/q88gsvz5221bdtht4ct6xp8r0000gn/T/TemporaryFile.h7wjCe.swift:41:12: error: incorrect argument label in call (have 'name:dependencies:linkerSettings:', expected 'name:dependencies:path:')
.target(name: "CNIOZlib",
^
'vapor' /Users/fnord/Documents/OpenSourceDev/vapor: error: product dependency 'ServiceKit' not found
'vapor' /Users/fnord/Documents/OpenSourceDev/vapor: error: product dependency 'Routing' not found
'vapor' /Users/fnord/Documents/OpenSourceDev/vapor: error: product dependency 'Command' not found
'vapor' /Users/fnord/Documents/OpenSourceDev/vapor: error: product dependency 'Console' not found