I hereby claim:
- I am jeanetienne on github.
- I am jeanetienne (https://keybase.io/jeanetienne) on keybase.
- I have a public key ASDvZWeP42F_TBBFEtbHUWLzs2GEjt1f6ID8anrvNHG63Qo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| // | |
| // Some styling architecture | |
| // | |
| class DefaultTheme { | |
| enum Color { | |
| static let primary: UIColor = .white | |
| static let secondary: UIColor = .gray | |
| } |
| // | |
| // More type-aware convenience functions for registering and dequeueing cells | |
| // | |
| import UIKit | |
| fileprivate extension UICollectionViewCell { | |
| static var defaultReuseIdentifier: String { | |
| return String(describing: self) |
| // | |
| // Logic necessary to implement a "closing handler" for a NSDocument | |
| // | |
| // This is inspired by: | |
| // - https://stackoverflow.com/questions/49343307/best-practice-to-implement-canclosewithdelegateshouldclosecontextinfo | |
| // - https://github.com/keith/radars/blob/master/NSDocumentSwiftAnnotations/NSDocumentSwiftAnnotations/Document.swift | |
| // Keith's supporting documentation for his radar submission: http://www.openradar.me/33422662 | |
| // Documentation: | |
| // - https://developer.apple.com/library/content/releasenotes/AppKit/RN-AppKitOlderNotes/ | |
| // Paragraph called: "Advice for Overriders of Methods that Follow the delegate:didSomethingSelector:contextInfo: Pattern" |
| // This extension is a port of @venj's solution from 2011 | |
| // https://github.com/venj/Cocoa-blog-code/blob/master/Round%20Corner%20Image/Round%20Corner%20Image/NSImage%2BRoundCorner.m | |
| extension NSImage { | |
| func roundCorners(withRadius radius: CGFloat) -> NSImage { | |
| let rect = NSRect(origin: NSPoint.zero, size: size) | |
| if | |
| let cgImage = self.cgImage, | |
| let context = CGContext(data: nil, |
| # For Homebrew (brew.sh) | |
| set -x PATH "/usr/local/bin:$PATH" | |
| # For Cask (caskroom.io) | |
| set -x HOMEBREW_CASK_OPTS "--caskroom=~/Documents/Caskroom --appdir=~/Applications" | |
| # Make TextMate the default editor | |
| set -x EDITOR "/usr/local/bin/mate -w" | |
| local alertDuration = 0.35 | |
| local log = hs.logger.new('jeanetienne','debug') | |
| -- Reload the config | |
| hs.hotkey.bind({"cmd", "alt", "ctrl"}, "R", function() | |
| hs.reload() | |
| hs.alert.show("Config loaded", 1) | |
| end) | |
| -- Resizing windows |