Given the following Markdown:
# Some Header
This is a paragraph with a [link](http://usewhiskey.com).
iA Writer says there are 12 words. Byword says there are 11. Whiskey, a Markdown text editor I’m working on, says there are 9. Count them.
// | |
// main.swift | |
// RoutingApproaches | |
// | |
// Created by Chris Eidhof on 01.08.18. | |
// Copyright © 2018 objc.io. All rights reserved. | |
// | |
import Foundation |
func ==<U: Equatable, T: protocol<RawRepresentable, Equatable> where T.RawValue == U>(lhs: U, rhs: T) -> Bool { | |
return lhs == rhs.rawValue | |
} | |
func !=<U: Equatable, T: protocol<RawRepresentable, Equatable> where T.RawValue == U>(lhs: U, rhs: T) -> Bool { | |
return lhs != rhs.rawValue | |
} |
extension Array { | |
func first() -> Element? { | |
if isEmpty { | |
return nil | |
} | |
return self[0] | |
} | |
func last() -> Element? { |
@import MobileCoreServices; | |
static CFStringRef UTTypeForImageData(NSData *data) { | |
const unsigned char * bytes = [data bytes]; | |
if (data.length >= 8) { | |
if (bytes[0] == 0x89 && bytes[1] == 0x50 && bytes[2] == 0x4E && bytes[3] == 0x47 && bytes[4] == 0x0D && bytes[5] == 0x0A && bytes[6] == 0x1A && bytes[7] == 0x0A) { | |
return kUTTypePNG; | |
} | |
} |
Given the following Markdown:
# Some Header
This is a paragraph with a [link](http://usewhiskey.com).
iA Writer says there are 12 words. Byword says there are 11. Whiskey, a Markdown text editor I’m working on, says there are 9. Count them.
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |