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
| let conversionMap: [Character: Character] = [ | |
| "\u{0021}" : "\u{00A1}", | |
| "\u{0022}" : "\u{201E}", | |
| "\u{0026}" : "\u{214B}", | |
| "\u{0027}" : "\u{002C}", | |
| "\u{0028}" : "\u{0029}", | |
| "\u{002E}" : "\u{02D9}", | |
| "\u{0033}" : "\u{0190}", | |
| "\u{0034}" : "\u{152D}", | |
| "\u{0036}" : "\u{0039}", |
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
| namespace :housekeeping do | |
| desc "Remove all header-comments" | |
| task :remove_header_comments do | |
| ["Classes", "Tests"].each do |directory| | |
| files = Dir["./#{directory}/**/*"].select { |value| File.file?(value) } | |
| files.each do |file| | |
| lines_array = File.open(file).readlines | |
| if lines_array.first.match(/^\/\//) && !lines_array.first.match(/^\/\/ DO NOT EDIT/) | |
| text = lines_array.drop_while { |line| line.match(/^\/\/|^\n/) } | |
| File.open(file, 'w') do |f| |
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
| final class CenteringView: UIView { | |
| // MARK: - Initialization | |
| init(contentView: UIView) { | |
| super.init(frame: .zero) | |
| addSubview(contentView) | |
| contentView.translatesAutoresizingMaskIntoConstraints = false | |
| NSLayoutConstraint.activateConstraints([ |
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
| // | |
| // PublicationCenter.swift | |
| // | |
| // Created by Brian King on 5/17/16. | |
| // Copyright © 2016 Raizlabs. All rights reserved. | |
| // | |
| import Foundation | |
| /// PublicationCenter is an NSNotificationCenter style object that |
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 CaseCountable { } | |
| extension CaseCountable where Self : RawRepresentable, Self.RawValue == Int { | |
| static var count: Int { | |
| var count = 0 | |
| while let _ = Self(rawValue: count) { count+=1 } | |
| return count | |
| } |
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
| struct APIError: NetworkError { | |
| let json: JSON | |
| let apiCode: Int? | |
| let message: String? | |
| let httpResponse: HTTPURLResponse |
OlderNewer