Very simple convenience class to make working with Auto-Layout easier.
class Layout {
let views: [String:UIView]
let superview: UIView
Taken directly from: https://developer.apple.com/library/mac/qa/qa1176/_index.html#//apple_ref/doc/uid/DTS10001707-CH1-SECRVI
iOS 5 added a remote virtual interface (RVI) facility that lets you use OS X packet trace programs to capture traces from an iOS device. The basic strategy is:
| // | |
| // ViewController.swift | |
| // Example | |
| // | |
| // Created by Nathan Borror on 8/28/14. | |
| // Copyright (c) 2014 Nathan Borror. All rights reserved. | |
| // | |
| import UIKit |
| class MasterViewController: UIViewController, UINavigationControllerDelegate { | |
| init() { | |
| super.init(nibName: nil, bundle: nil) | |
| } | |
| } | |
| extension MasterViewController: UITableViewDataSource { | |
| func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int { |
| Host e | |
| HostName 54.208.83.100 | |
| User ubuntu | |
| IdentityFile ~/.ssh/your-key-pair.pem |
| description "start and stop the go program 'my-project'" | |
| start on filesystem or runlevel [2345] | |
| stop on runlevel [!2345] | |
| env USER='ubuntu' | |
| env APP_DIR='/home/ubuntu/go/src/github.com/your-username/your-project-name/' | |
| env APP_EXEC='your-project-name' | |
| exec start-stop-daemon —start —chuid ${USER} —chdir ${APP_DIR} —exec ${APP_DIR}${APP_EXEC} |
I hereby claim:
To claim this, I am signing this object:
| // NSArray *formats = @[ | |
| // @"H:|-[textView]-|", | |
| // @"H:|-[moreButton]-|", | |
| // @"V:|-[textView]-[moreButton]-|", | |
| // ]; | |
| // [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormats:formats options:0 metrics:nil views:views]]; | |
| @implementation NSLayoutConstraint (Common) |
I'm going to be deprecating the current Readernaut API in favor of a newer more built-out version. People using the current version have two weeks to switch over to the new API. Currently you can find your API_KEY by viewing source on any page and searching for "api_key" in the output (this will get better later). Here are some example endpoints:
/services/api/USERNAME/notes//api/v1/notes/note/?username=YOUR_USERNAME&api_key=YOUR_API_KEY&user__username=USERNAME| define([], function(obj) { | |
| var channels = {}; | |
| if (!obj) obj = {}; | |
| obj.subscribe = function(channel, subscription) { | |
| if (!channels[channel]) channels[channel] = []; | |
| channels[channel].push(subscription); | |
| return channels[channel].length -1; | |
| }; |