Proxy to services based on Accept
header.
docker-compose up -d
People experimenting with kubernetes clusters on the GKE not necessarily have money to keep a full cluster on at all time. GKE clusters can be easily resized, but this still incurs in the full instance cost when the cluster is up.
Google has added preemptible instances that are ideal for many
Credit where credit's due, I mainly used these 3 resources to get this all working. There were several others but I don't exactly remember which is which. So at least here are the 3 main places that I used. | |
The vast majority of this came from this link, the others helped me make it work for Plex. | |
http://emby.media/community/index.php?/topic/30975-reverse-proxy-with-ssl-hostname-routing-and-embyopenvpn-port-sharing/ | |
https://gist.github.com/spikegrobstein/4384954 | |
https://forums.plex.tv/discussion/207725/ubuntu-14-04-4-lts-plex-incorrectly-handles-lower-case-headers#latest | |
The data flow here is: |
docker run --name rancher-mysql -v /data/docker/rancher/mysql:/var/lib/mysql --restart=always -d \ | |
-e MYSQL_ROOT_PASSWORD=my-secret-pw \ | |
-e MYSQL_USER=rancher \ | |
-e MYSQL_PASSWORD=my-secret-pw \ | |
-e MYSQL_DATABASE=rancher \ | |
mysql | |
docker run --name rancher-server -d --restart=always --link rancher-mysql:mysql -p 80:8080 \ | |
-e CATTLE_DB_CATTLE_MYSQL_HOST=$MYSQL_PORT_3306_TCP_ADDR \ | |
-e CATTLE_DB_CATTLE_MYSQL_PORT=3306 \ |
// AFNetworking | |
[[AFHTTPSessionManager manager] GET:@"http://httpbin.org/ip" parameters:nil success:^(NSURLSessionDataTask *task, id JSON) { | |
NSLog(@"IP Address: %@", JSON[@"origin"]); | |
} failure:^(NSURLSessionDataTask *task, NSError *error) { | |
NSLog(@"Error: %@", error); | |
}]; | |
// NSURLSession | |
NSURL *URL = [NSURL URLWithString:@"http://httpbin.org/ip"]; |
import co from 'co' | |
// Generator controller, | |
// this.models refers to Sequelize models added with server.bind() | |
function* loginController(request) { | |
let user = yield this.models.User.find({ | |
where: { | |
email: request.payload.email | |
} |
/// Observes a run loop to detect any stalling or blocking that occurs. | |
/// | |
/// This class is thread-safe. | |
@interface GHRunLoopWatchdog : NSObject | |
/// Initializes the receiver to watch the specified run loop, using a default | |
/// stalling threshold. | |
- (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
/// Initializes the receiver to detect when the specified run loop blocks for |
#pragma mark - WKUIDelegate | |
- (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)())completionHandler | |
{ | |
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil | |
message:message | |
preferredStyle:UIAlertControllerStyleAlert]; | |
[alert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { | |
completionHandler(); |
Suppose we want to add support for a new iOS 8 API in our framework that replaces an older iOS 7 API. There are a few problems we might face:
These three problems require three different technical solutions:
respondsToSelector:
)__IPHONE_OS_VERSION_MAX_ALLOWED
macro