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 UIKit | |
| extension UIColor { | |
| static func colorWithHex(hex RGBAHex: String) -> UIColor? { | |
| if !RGBAHex.hasPrefix("#") { | |
| return nil | |
| } | |
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
| export PS1="\w \[\e[0;33m\]\`ruby ~/.theme/git.rb\` \[\e[0m\]\\$ " |
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
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| func helloWorld() -> Void { | |
| print("hello, world!") | |
| } | |
| helloWorld() |
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
| function branch_status { | |
| branch=`branch` | |
| [ -n "$branch" ] && echo "[$branch`dirty_status`] " || echo | |
| } | |
| function branch { | |
| git branch | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |
| } | |
| function dirty_status { |
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
| protocol Foo { | |
| func foo(_ int: Int) | |
| } | |
| extension Foo { | |
| func foo(_ int: Int = 1) { print("foo") } | |
| func bar() { print("bar") } | |
| } | |
| func testFoo(foo: Foo) { |
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
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| protocol Async: class, Task { | |
| } | |
| extension Waterfall: Async { | |
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
| extension String { | |
| func unescapeHTMLEntities() throws -> String { | |
| guard contains("&#") else { | |
| return self | |
| } | |
| guard let data = data(using: .utf8) else { | |
| return self |
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
| func makeTestViewControllerTransitionCoordinator() -> UIViewControllerTransitionCoordinator { | |
| class ViewControllerTransitionCoordinator: NSObject, UIViewControllerTransitionCoordinatorContext, UIViewControllerTransitionCoordinator { | |
| public var isAnimated: Bool { return false } | |
| public var presentationStyle: UIModalPresentationStyle { return .formSheet } | |
| public var initiallyInteractive: Bool { return false } | |
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
| use std::time::Instant; | |
| fn main() { | |
| let start = Instant::now(); | |
| let input = env!("PRESENTS"); | |
| let (index, _sum) = find_sum_of_divisors_over(input.parse::<u32>().unwrap() / 10); | |
| println!("{}", index); |
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
| //: Playground - noun: a place where people can play | |
| import Foundation | |
| import PlaygroundSupport | |
| class Waterfall<T> { | |
| typealias Execute = (@escaping (Result<T>) -> Void) throws -> Void | |
| typealias Callback = (Result<T>) -> Void | |
OlderNewer