One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Adding Hidden Agendas | |
Adjusting Bell Curves | |
Aesthesizing Industrial Areas | |
Aligning Covariance Matrices | |
Applying Feng Shui Shaders | |
Applying Theatre Soda Layer | |
Asserting Packed Exemplars | |
Attempting to Lock Back-Buffer | |
Binding Sapling Root System | |
Breeding Fauna |
// | |
// RN3DTouchGestureRecognizer.swift | |
// | |
// Created by Ryan Nystrom on 10/10/15. | |
// Copyright © 2015 Ryan Nystrom. All rights reserved. | |
// | |
import UIKit.UIGestureRecognizerSubclass | |
class RN3DTouchGestureRecognizer: UIGestureRecognizer { |
import UIKit | |
class MyViewController: UIViewController { | |
// Store ref and handle as implicitly unwrapped optionals | |
var ref: Firebase! | |
var handle: UInt! | |
override func viewDidLoad() { | |
super.viewDidLoad() |
package main | |
import ( | |
"net/http" | |
"log" | |
) | |
func redirect(w http.ResponseWriter, req *http.Request) { | |
// remove/add not default ports from req.Host | |
target := "https://" + req.Host + req.URL.Path | |
if len(req.URL.RawQuery) > 0 { |
import UIKit | |
extension UIImage { | |
subscript (x: Int, y: Int) -> UIColor? { | |
guard x >= 0 && x < Int(size.width) && y >= 0 && y < Int(size.height), | |
let cgImage = cgImage, | |
let provider = cgImage.dataProvider, | |
let providerData = provider.data, | |
let data = CFDataGetBytePtr(providerData) else { | |
return nil |
import CoreData | |
protocol Fetchable | |
{ | |
typealias FetchableType: NSManagedObject | |
static func entityName() -> String | |
static func objectsInContext(context: NSManagedObjectContext, predicate: NSPredicate?, sortedBy: String?, ascending: Bool) throws -> [FetchableType] | |
static func singleObjectInContext(context: NSManagedObjectContext, predicate: NSPredicate?, sortedBy: String?, ascending: Bool) throws -> FetchableType? | |
static func objectCountInContext(context: NSManagedObjectContext, predicate: NSPredicate?) -> Int |
/// custom unique identifier | |
/// @see https://www.firebase.com/blog/2015-02-11-firebase-unique-identifiers.html | |
private let ASC_CHARS = Array("-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz") | |
private let DESC_CHARS = ASC_CHARS.reverse() | |
private var lastPushTime: UInt64 = 0 | |
private var lastRandChars = Array<Int>(count: 12, repeatedValue: 0) | |
func generatePushID(ascending: Bool = true) -> String { | |
let PUSH_CHARS = ascending ? ASC_CHARS: DESC_CHARS | |
var timeStampChars = Array<Character>(count: 8, repeatedValue: PUSH_CHARS.first!) |
// request Game Center verification data for localPlayer from apple | |
- (void)authenticateGameCenterPlayer:(GKLocalPlayer *)localPlayer | |
{ | |
[localPlayer generateIdentityVerificationSignatureWithCompletionHandler:^(NSURL *publicKeyUrl, NSData *signature, NSData *salt, uint64_t timestamp, NSError *error) { | |
if (error) { | |
NSLog(@"ERROR: %@", error); | |
} | |
else { | |
// package data to be sent to server for verification | |
NSDictionary *params = @{@"publicKeyUrl": publicKeyUrl, |