Skip to content

Instantly share code, notes, and snippets.

View ryanwilson's full-sized avatar

Ryan Wilson ryanwilson

  • Google
  • Waterloo, ON
View GitHub Profile
@ryanwilson
ryanwilson / WatchOS9Websockets.swift
Last active September 16, 2022 14:12
watchOS 9 on device websocket failure
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@ryanwilson
ryanwilson / Unload Filament after this print
Created February 17, 2022 16:26
Klipper Macro Examples
Description: allows you to select if you'd like to have the filament unloaded at the end
of the print, or for it to stay in the hotend. Defaults to staying in the hotend.
In your `PRINT_END` macro, add this variable:
```
[gcode_macro PRINT_END]
# Keeps track of whether filament should be unloaded or kept at the end of the print.
variable_keep_printing: True
```
@ryanwilson
ryanwilson / SwiftUIPlayground.swift
Last active September 17, 2019 02:35
SwiftUI failure with @binding and @State
struct SwiftUIPlayground: View {
@Binding var isOn: Bool
var body: some View {
Text("ON").scaleEffect(isOn ? 10 : 1)
}
}
struct SwiftUIPlayground_Previews: PreviewProvider {
@State static var isOn: Bool = false
@ryanwilson
ryanwilson / 5inch.svg
Last active April 6, 2017 02:48
Table Number
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ryanwilson
ryanwilson / nails_outer.svg
Last active January 25, 2017 23:05
Nail Polish Holder
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
//: Playground - noun: a place where people can play
import UIKit
import XCPlayground
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
let url = NSURL(string: "http://jsonplaceholder.typicode.com/users/3")
let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithURL(url!, completionHandler: { (data: NSData?, response: NSURLResponse?, error: NSError?) -> Void in