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
private struct FavoritesModelConnectingType: RawOptionSetType { | |
private var value: UInt = 0 | |
init(_ value: UInt) { | |
self.value = value | |
} | |
// MARK: RawOptionSetType | |
static func fromMask(raw: UInt) -> FavoritesModelConnectingType { | |
return self(raw) | |
} |
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
// UserDefaults.swift | |
// | |
// Copyright (c) 2015 muukii | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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 UIImage { | |
func fixOrientation () -> UIImage { | |
if self.imageOrientation == .Up { | |
return self | |
} | |
var transform = CGAffineTransformIdentity | |
let width = self.size.width | |
let height = self.size.height | |
switch (self.imageOrientation) { |
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
// | |
// GLKCIImageView.swift | |
// Fil | |
// | |
// Created by Muukii on 9/1/15. | |
// Copyright © 2015 muukii. All rights reserved. | |
// | |
import Foundation | |
import GLKit |
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
console.log('abc'); |
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 Realm { | |
public var queue: NSOperationQueue { | |
get { | |
if let queue = objc_getAssociatedObject(self, &StoredPropaties.queue) as? NSOperationQueue { | |
return queue | |
} | |
let queue = self.createDefaultQueue() | |
self.queue = queue |
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
// MainStore: Realm | |
MainStore.writeBackground( | |
{ (store: Realm) in | |
let photos: [Photo] = json.arrayValue.map { json in | |
let photo = Photo() | |
photo.update(json) | |
return photo | |
} | |
store.add(photos, update: 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
// App Module | |
class MyAppClass { | |
class NestedClass { } | |
} | |
// Module | |
class MyModuleClass { | |
class NestedClass {} | |
} |
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
public protocol Instantiatable: class { | |
static func instantiate() -> Self | |
} | |
public protocol InstantiatableFromXIB: Instantiatable { | |
} | |
public protocol InstantiatableFromStoryboard: Instantiatable { |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to make opened Markdown files always be soft wrapped: | |
# | |
# path = require 'path' | |
# |