Guide to add localhost:80 to localhost:8080 forwarding.
Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.
####1. anchor file
| # this is a dirty implementation of logger that | |
| # compiles AR queries with trace into /last_request_log.html | |
| # the snippet is useful when optimizing performance of the endpoint | |
| class QueryLogSubscriber < ActiveSupport::LogSubscriber | |
| TRACE_LEVEL = :app | |
| LINES = 5 | |
| IGNORE_CACHED_QUERIES = false | |
| def initialize |
| #import <Cocoa/Cocoa.h> | |
| @interface NSColor (isLight) | |
| - (BOOL)isLight; | |
| @end |
A list of Sketch plugins hosted at GitHub, in no particular order.
| static BOOL PSPDFIsDevelopmentBuild(void) { | |
| #if TARGET_IPHONE_SIMULATOR | |
| return YES; | |
| #else | |
| static BOOL isDevelopment = NO; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| // There is no provisioning profile in AppStore Apps. | |
| NSData *data = [NSData dataWithContentsOfFile:[NSBundle.mainBundle pathForResource:@"embedded" ofType:@"mobileprovision"]]; | |
| if (data) { |
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| // PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> |