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
[mutableAttributedString addAttribute:NSBaselineOffsetAttributeName | |
value:@(-1.) | |
range:NSMakeRange(0, 1)]; |
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
<!-- Code syntax highlight --> | |
<link href="http://static.tumblr.com/7ugkukk/n2bn9udeb/tomorrow-night.css" type="text/css" rel="stylesheet" /> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript " src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
var code = $('code'); | |
code.replaceWith('<pre>'+code.text()+'</pre>'); | |
$('pre').css({ | |
'overflow-x': 'scroll', |
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
var fetchedResultsController: NSFetchedResultsController { | |
if _fetchedResultsController != nil { | |
return _fetchedResultsController! | |
} | |
let fetchRequest = NSFetchRequest() | |
// Edit the entity name as appropriate. | |
let entity = NSEntityDescription.entityForName(CPCommentObject.entityName(), inManagedObjectContext: NSManagedObjectContext.managedObjectContextForMainThread()) | |
fetchRequest.entity = entity |
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
// BaseViewController.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
// | |
// MTKCIImageView.swift | |
// Fil | |
// | |
// Created by Muukii on 9/27/15. | |
// Copyright © 2015 muukii. All rights reserved. | |
// | |
import Foundation | |
import Metal |
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
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 |