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
// | |
// NSWindow+Fade.swift | |
// BH Bezel Notification | |
// | |
// Created by Ben Leggiero on 2017-11-09. | |
// Translated to Swift 4 from the original (ObjC): https://gist.github.com/indragiek/1397050 | |
// Copyright © 2017 Ben Leggiero. All rights reserved. | |
// | |
import Foundation |
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
// | |
// Swift range conformance check.swift | |
// Requires Swift 4 | |
// | |
// Created by Ben Leggiero on 2017-11-06. | |
// Copyright © 2017 Ben Leggiero using BH-1-PS license | |
// | |
// This is a proof-of-concept that attempts to create a syntax like "left < center < right", which ensures that | |
// "center" is both greater than "left" and less than "right". |
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 Cocoa | |
public extension NSApplication { | |
public func relaunch(afterDelay seconds: TimeInterval = 0.5) -> Never { | |
let task = Process() | |
task.launchPath = "/bin/sh" | |
task.arguments = ["-c", "sleep \(seconds); open \"\(Bundle.main.bundlePath)\""] |
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
/// Example type | |
public struct Foo { | |
// Fields... | |
} | |
/// Wraps `Foo` so it can be used for that static variable later | |
private struct FooWrapper { |
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
Control: | |
file:/// => file:/// | |
file:///etc/ => file:///etc/ | |
~/ -- file:/// => ~/ -- file:/// | |
~/Desktop -- file:/// => ~/Desktop -- file:/// | |
~/.bash_profile -- file:/// => ~/.bash_profile -- file:/// | |
./ -- file:/// => ./ -- file:/// | |
../ -- file:/// => ../ -- file:/// | |
file:///etc/../ => file:///etc/../ | |
~/../ -- file:/// => ~/../ -- file:/// |
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
// Copyright Ben Leggiero 2017 BH-1-PS | |
// https://github.com/BlueHuskyStudios/Licenses/blob/master/Licenses/BH-1-PS.txt | |
import Foundation | |
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
// Made to answer http://stackoverflow.com/questions/38512761/how-do-i-find-the-x-y-coordinates-of-the-point-q-on-a-closed-2d-composite-bez | |
struct BezierPoint { | |
let q0: CGPoint | |
let point: CGPoint | |
let q1: CGPoint | |
} | |
struct SimpleBezierCurve { | |
let left: BezierPoint |
NewerOlder