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
# -- Changing Window Focus -- | |
# change window focus within space | |
alt + ctrl - k : yabai -m window --focus north | |
alt + ctrl - l : yabai -m window --focus east | |
alt + ctrl - j : yabai -m window --focus south | |
alt + ctrl - h : yabai -m window --focus west | |
#change focus between external displays (left and right) | |
alt + ctrl + shift - n: yabai -m display --focus east |
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 SwiftUI | |
/// Diameter of the circle that represents an individual step in the stepper | |
private let ITEM_DIAMETER: CGFloat = 24 | |
/// Intended to be implemented by an enum that models each step in a progress stepper | |
protocol ProgressStepperDescriptor { | |
/// Get all steps for a given instance. This allows an enum to provide some subset of its cases to the stepper rather than | |
/// assuming that MyEnum.allCases is always representative of what the user sees. | |
func getSteps() -> [ProgressStepperDescriptor] |
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 DictionaryCoding | |
/// Note: This relies on the DictionaryCoding package https://github.com/elegantchaos/DictionaryCoding | |
struct QueryParamEncoder { | |
func encode<T: Encodable>(_ item: T) throws -> String { | |
let encoder = DictionaryEncoder() | |
let encoded: [String: Any] = try encoder.encode(item) | |
let queryParams = encodeDictionary(encoded) | |
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
// Defines constants for all websocket close event codes that are used in practice | |
// Link: https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent | |
/** | |
* Normal closure; the connection successfully completed whatever purpose for which it was created. | |
*/ | |
const NORMAL_CLOSURE = 1000 | |
/** | |
* The endpoint is going away, either because of a server failure |