OrcaSlicer favicon
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
| blueprint: | |
| name: E-Bike Smart Charge | |
| description: > | |
| Charges an e-bike battery during off-peak hours via a smart plug, | |
| stopping automatically when the target charge level is reached. | |
| ## How it works | |
| The blueprint measures energy delivered via the smart plug's kWh sensor |
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
| { | |
| "map": | |
| [ | |
| 799,759,719,679,639,599,559,519,479,439,399,359,319,279,239,199,159,119,79,39, | |
| 760,720,680,640,600,560,520,480,440,400,360,320,280,240,200,160,120,80,40,0, | |
| 761,721,681,641,601,561,521,481,441,401,361,321,281,241,201,161,121,81,41,1, | |
| 762,722,682,642,602,562,522,482,442,402,362,322,282,242,202,162,122,82,42,2, | |
| 763,723,683,643,603,563,523,483,443,403,363,323,283,243,203,163,123,83,43,3, | |
| 764,724,684,644,604,564,524,484,444,404,364,324,284,244,204,164,124,84,44,4, | |
| 765,725,685,645,605,565,525,485,445,405,365,325,285,245,205,165,125,85,45,5, |
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 CryptoKit | |
| import Foundation | |
| extension Data { | |
| init?(base32Encoded string: String) { | |
| let alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" | |
| var bytes: [UInt8] = [] | |
| var accum = 0 | |
| var bits = 0 // # of valid bits in `accum` |
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
| #!/bin/sh | |
| cat MyProject.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | python3 package_from_spm_xcodeproj.py > Package.swift && swiftlint --strict ./Package.swift |
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 Publisher { | |
| func and<T: Publisher>(_ closure: @escaping (Output) -> T) -> AnyPublisher<(Output, T.Output), Failure> where T.Failure == Failure { | |
| then { output in | |
| Just(output) | |
| .setFailureType(to: Failure.self) | |
| .zip(closure(output)) | |
| .eraseToAnyPublisher() | |
| } | |
| } |
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 UIView.AnimationCurve { | |
| var animationOption: UIView.AnimationOptions { | |
| switch self { | |
| case .easeInOut: | |
| return .curveEaseInOut | |
| case .easeIn: | |
| return .curveEaseIn | |
| case .easeOut: | |
| return .curveEaseOut | |
| case .linear: |
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
| //part1 | |
| void main() { | |
| int floor = 0; | |
| for (int i = 0; i < input.length; ++i) { | |
| if (input[i] == ")") --floor; | |
| else if (input[i] == "(") ++floor; | |
| } | |
| print(floor); | |
| } |
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
| main() async { | |
| int frequency = 0; | |
| List<String> numberArray = input.split("\n"); | |
| for (int i = 0; i < numberArray.length; ++i) { | |
| int number = int.parse(numberArray[i]); | |
| frequency += number; | |
| } | |
| print("Frequency: $frequency"); | |
| } |
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 UIKit | |
| protocol LayoutAttributeConvertible { | |
| var layoutAttribute: NSLayoutAttribute { get } | |
| } | |
| enum Edge: LayoutAttributeConvertible { | |
| case left | |
| case right | |
| case top |
NewerOlder