Skip to content

Instantly share code, notes, and snippets.

View DreamingInBinary's full-sized avatar

Jordan Morgan DreamingInBinary

View GitHub Profile
//
// IGNNetworking.swift
// Unofficial Metacritic
//
// Created by Jordan Morgan on 8/21/16.
// Copyright © 2016 Dreaming In Binary, LLC. All rights reserved.
//
import Foundation
import UIKit
//
// IGNNetworking.swift
// Unofficial Metacritic
//
// Created by Jordan Morgan on 8/22/16.
// Copyright © 2016 Dreaming In Binary, LLC. All rights reserved.
//
import Foundation
//
// NetworkError.swift
// Unofficial Metacritic
//
// Created by Jordan Morgan on 8/29/16.
// Copyright © 2016 Dreaming In Binary, LLC. All rights reserved.
//
import Foundation
//
// ViewController.swift
// The Unofficial IGN App
//
// Created by Jordan Morgan on 8/21/16.
// Copyright © 2016 Dreaming In Binary, LLC. All rights reserved.
//
import UIKit
@DreamingInBinary
DreamingInBinary / oldComments.m
Last active March 28, 2017 17:24
Retrieving old comments in the Buffer Retreat App V1
PFQuery *query = [self.event.comments query];
[query includeKey:@"created_by"];
[query orderByAscending:@"createdAt"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error){
//Handle comments
}];
cp -r /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0\ \(15A5278f\) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
@DreamingInBinary
DreamingInBinary / ASDisplayNode+BFREmptyView.m
Created November 14, 2017 16:07
Empty data set for ASDisplayNode
//
// ASDisplayNode+BFREmptyView.m
// Buffer
//
// Created by Jordan Morgan on 10/27/17.
//
#import "ASDisplayNode+BFREmptyView.h"
#import <objc/runtime.h>
#import <AsyncDisplayKit/AsyncDisplayKit.h>
@DreamingInBinary
DreamingInBinary / DownloadingAModel.m
Last active February 22, 2018 18:45
Machine Learning Blog Post: Snip 1
// Once you get the NSData from the download task from where you hosted the file...
#pragma mark - Local Storage
// A 4 Step Process
// 1) Save off the NSData of the Core ML model to a temporary spot
// 2) Compile the model from that URL, whic gives us another temporary URL of where it's compiled at
// 3) Create a permanent URL by appending the temporary URL that was generated. This is what initlizes stuff
// 4) Save the permanent URL for later use
- (void)saveModelData:(NSData *)data {
@DreamingInBinary
DreamingInBinary / Inference.m
Created February 22, 2018 18:46
Machine Leaning Blog Post: Snip 2
//
// Inceptionv3.h
//
// This file was automatically generated and should not be edited.
//
#import <Foundation/Foundation.h>
#import <CoreML/CoreML.h>
#include <stdint.h>
@DreamingInBinary
DreamingInBinary / Demo.m
Last active February 22, 2018 18:48
Machine Learning Blog Post: Snip 3
#pragma mark - Private Classifiers
- (void)classifyWithModelForImage:(UIImage *)image completion:(void (^)(NSDictionary <NSString *, NSString *> *))completion {
dispatch_async(dispatch_get_global_queue(QOS_CLASS_UTILITY, 0), ^{
NSMutableDictionary *returnValues = [NSMutableDictionary new];
CVPixelBufferRef pixelBuffer = [self generatePixelBufferFromImage:image];
if (pixelBuffer == nil) {
completion(nil);
return;