$ sudo npm install -g hexo-cli
$ hexo -v
hexo-cli: 0.1.9
This file contains 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 PlaygroundSupport | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
func async<T>(_ executable: @escaping @autoclosure () -> T, _ priority: DispatchQoS.QoSClass = DispatchQoS.QoSClass.default, completion: @escaping (T) -> Void) { | |
DispatchQueue.global(qos: priority).async { | |
let result = executable() | |
DispatchQueue.main.async { |
This file contains 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
let normalAttributes = [NSFontAttributeName: UIFont(font: SomeFont, size: 12), NSForegroundColorAttributeName: UIColor.redColor()] | |
let highlightedAttributes = [NSFontAttributeName: UIFont(font: SomeFont, size: 12), NSForegroundColorAttributeName: UIColor.whiteColor()] | |
let tabBarItem = UITabBarItem(title: "Button", image: UIImage(named: "Button")!, selectedImage: UIImage(named: "Button_selected")!) | |
tabBarItem.setTitleTextAttributes(highlightedAttributes, forState: .Highlighted) | |
tabBarItem.setTitleTextAttributes(normalAttributes, forState: .Normal) |
This file contains 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
#!/usr/bin/env bash | |
# | |
# Bootstrap script for setting up a new OSX machine | |
# | |
# This should be idempotent so it can be run multiple times. | |
# | |
# Some apps don't have a cask and so still need to be installed by hand. These | |
# include: | |
# | |
# - Twitter (app store) |
This file contains 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 { | |
public var image: UIImage? { | |
UIGraphicsBeginImageContextWithOptions(bounds.size, false, 0.0) | |
defer { UIGraphicsEndImageContext() } | |
return UIGraphicsGetCurrentContext().flatMap { [unowned self] _ in | |
self.drawHierarchy(in: bounds, afterScreenUpdates: true) | |
return UIGraphicsGetImageFromCurrentImageContext() | |
} | |
// return UIGraphicsGetCurrentContext().flatMap { [unowned self] context in |
This file contains 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 { | |
@objc func exerciseAmbiguityInLayoutRepeatedly() { | |
if self.hasAmbiguousLayout { | |
Timer.scheduledTimer(timeInterval: 0.5, | |
target: self, | |
selector: #selector(UIView.exerciseAmbiguityInLayout), | |
userInfo: nil, | |
repeats: true) | |
} | |
} |
This file contains 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
#!/usr/bin/swift sh | |
import Foundation | |
import PromiseKit // @mxcl ~> 6.5 | |
import Swifter // @mattdonnelly == b27a89 | |
let swifter = Swifter( | |
consumerKey: "FILL", | |
consumerSecret: "ME", | |
oauthToken: "IN", | |
oauthTokenSecret: "https://developer.twitter.com/en/docs/basics/apps/overview.html" |
This file contains 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
[user] | |
name = Vladyslav Skintiian | |
email = PUT EMAIL HERE | |
username = vskintiyan | |
editor = code | |
[merge] | |
tool = vscode | |
[mergetool "vscode"] | |
cmd = code --wait $MERGED | |
[diff] |
This file contains 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
protocol Holable { | |
static var hole: Self { get } | |
} | |
extension Holable { | |
static var hole: Self { | |
fatalError() | |
} | |
} |