I hereby claim:
- I am zef on github.
- I am zef (https://keybase.io/zef) on keybase.
- I have a public key whose fingerprint is F64A 8E5B F886 3060 D810 54AC D97C 988F 6778 C42C
To claim this, I am signing this object:
// This is a 3d printable tailgate latch rod clip that fits my 1995 Toyota T100. | |
// intended to be printed as oriented, with the insert pin facing up | |
// Using dependencies helps keep me sane. Please excuse the inconvenience of installation :) | |
// https://github.com/revarbat/BOSL/wiki | |
// | |
// Installation instructions: https://github.com/revarbat/BOSL/wiki | |
include <BOSL/constants.scad> |
// Created by Zef Houssney on 1/9/20. | |
// This takes some inspiration from https://gist.github.com/chriseidhof/3c6ea3fb2102052d1898d8ea27fbee07 | |
// but uses a different approach. | |
// Instead of trying to calculate the position of each item and placing them manually using calculated coordinates, | |
// this calculates the amount of space each item wants to take up, then splits the items into rows that should fit | |
// within the available width. | |
// Then, the views are distributed into rows, made up of an HStack for each row inside a VStack. | |
// | |
// This seems non-conventional, but I was having trouble getting the frame of my top-level view to be respected when returning |
protocol Pluralizable { | |
static var singular: String { get } | |
// Override with the correct plural, if simply appending an "s" is incorrect | |
static var plural: String { get } | |
} | |
extension Pluralizable { | |
static var singular: String { | |
return String(describing: self) | |
} |
// | |
// Reusable.swift | |
// | |
// Created by Zef Houssney | |
// | |
import UIKit | |
protocol Reusable { | |
static var reuseIdentifier: String { get } |
I hereby claim:
To claim this, I am signing this object:
protocol ValueEnumerable { | |
static var allValues: [Any] { get } | |
} | |
enum ColorScheme: ValueEnumerable { | |
typealias SchemeTuple = (name: String, background: UIColor, foreground: UIColor, border: UIColor) | |
case Light | |
case Dark | |
case custom(SchemeTuple) |
extension NSURL { | |
var queryDictionary: [String: String] { | |
guard let components = NSURLComponents(string: absoluteString), items = components.queryItems else { return [:] } | |
return items.reduce([:]) { dictionary, item in | |
var dictionary = dictionary | |
dictionary[item.name] = item.value | |
return dictionary | |
} | |
} |
#!/usr/bin/env ruby | |
if remote = `git remote -v`.lines.find { |l| l.match /bitbucket/ } | |
matches = remote.match /(?<domain>bitbucket.org).(?<path>.*)\.git/ | |
url = "https://#{matches[:domain]}/#{matches[:path]}" | |
branch = `git symbolic-ref --short HEAD`.lines.first | |
url += "/branch/#{branch}" | |
system "open #{url}" |
- (UIImage *)imageByShiftingFromColor:(UIColor *)startColor toColor:(UIColor *)endColor | |
{ | |
CGFloat startHue, startSaturation, startBrightness, startAlpha; | |
BOOL parsedStartColor = [startColor getHue:&startHue saturation:&startSaturation brightness:&startBrightness alpha:&startAlpha]; | |
NSLog(@"start success: %i hue: %0.2f, saturation: %0.2f, brightness: %0.2f, alpha: %0.2f", parsedStartColor, startHue, startSaturation, startBrightness, startAlpha); | |
CGFloat endHue, endSaturation, endBrightness, endAlpha; | |
BOOL parsedEndColor = [endColor getHue:&endHue saturation:&endSaturation brightness:&endBrightness alpha:&endAlpha]; | |
NSLog(@"end success: %i hue: %0.2f, saturation: %0.2f, brightness: %0.2f, alpha: %0.2f", parsedEndColor, endHue, endSaturation, endBrightness, endAlpha); |