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
Clean the following folders referring to http://ajithrnayak.com/post/95441624221/xcode-users-can-free-up-space-on-your-mac | |
~/Library/Developer/Xcode/DerivedData | |
~/Library/Developer/Xcode/Archives | |
~/Library/Developer/Xcode/iOS DeviceSupport | |
~/Library/Developer/CoreSimulator | |
~/Library/Caches/com.apple.dt.Xcode | |
~/Library/Application Support/MobileSync/ | |
xcrun simctl delete unavailable |
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
for f in *\ *; do mv "$f" "${f// /_}"; done |
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
# SwiftLint configuration file | |
# | |
# Used for DEBUG builds. | |
# | |
# rule identifiers to exclude from running | |
disabled_rules: | |
- line_length # to be used | |
- function_body_length | |
- type_body_length |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlackColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NGMCAw | |
IDAAEAGAAtIQERITWiRjbGFzc25hbWVYJGNsYXNzZXNXTlNDb2xvcqISFFhOU09iamVj | |
dF8QD05TS2V5ZWRBcmNoaXZlctEXGFRyb290gAEIERojLTI3O0FITltiaWttcn2GjpGa |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlackColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NGMCAw | |
IDAAEAGAAtIQERITWiRjbGFzc25hbWVYJGNsYXNzZXNXTlNDb2xvcqISFFhOU09iamVj | |
dF8QD05TS2V5ZWRBcmNoaXZlctEXGFRyb290gAEIERojLTI3O0FITltiaWttcn2GjpGa |
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
/// Wraps the observer token received from | |
/// NotificationCenter.addObserver(forName:object:queue:using:) | |
/// and unregisters it in deinit. | |
final class NotificationToken: NSObject { | |
let notificationCenter: NotificationCenter | |
let token: Any | |
init(notificationCenter: NotificationCenter = .default, token: Any) { | |
self.notificationCenter = notificationCenter | |
self.token = token |
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
//Copyright | |
//https://habrahabr.ru/post/271647/ | |
import Foundation | |
// Summ and Substraction of Vectors | |
func +(left: CGPoint, right: CGPoint)->CGPoint{ | |
return CGPoint(x: left.x+right.x, y: left.y+right.y) | |
} | |
prefix func -(right: CGPoint)->CGPoint{ |
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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/alex-potapov/.oh-my-zsh | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes | |
ZSH_THEME="robbyrussell" |
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
func uniq<S: SequenceType, E: Hashable where E==S.Generator.Element>(source: S) -> [E] { | |
var seen: [E:Bool] = [:] | |
return source.filter { seen.updateValue(true, forKey: $0) == nil } | |
} |
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 Array { | |
func groupBy<G: Hashable>(groupClosure: (Element) -> G) -> [[Element]] { | |
var groups = [[Element]]() | |
for element in self { | |
let key = groupClosure(element) | |
var active = Int() | |
var isNewGroup = true | |
var array = [Element]() |