kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
protocol DefaultValue { | |
associatedtype Value: Decodable | |
static var defaultValue: Value { get } | |
} | |
@propertyWrapper | |
struct Default<T: DefaultValue> { | |
var wrappedValue: T.Value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: | |
document.querySelectorAll('.load-diff-button').forEach(node => node.click()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum -y install epel_release | |
sudo yum -y install gcc gcc-c++ python-pip python-devel atlas atlas-devel gcc-gfortran openssl-devel libffi-devel | |
pip install --upgrade virtualenv | |
virtualenv --system-site-packages ~/venvs/tensorflow | |
source ~/venvs/tensorflow/bin/activate | |
pip install --upgrade numpy scipy wheel cryptography #optional | |
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl | |
# or below if you want gpu, support, but cuda and cudnn are required, see docs for more install instructions | |
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Release under MIT | |
// Copyright (C) 2015 Xaree Lee | |
#import <Foundation/Foundation.h> | |
/* Get property name for the class (C string or NSSting). */ | |
#define keypathForClass(Klass, PropertyName) \ | |
(((void)(NO && ((void)[Klass _nullObjectForCheckingPropertyName].PropertyName, NO)), # PropertyName)) | |
#define keypathStringForClass(Klass, PropertyName) \ | |
@keypathForClass(Klass, PropertyName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.m | |
// AVPlayerCaching | |
// | |
// Created by Anurag Mishra on 5/19/14. | |
// Sample code to demonstrate how to cache a remote audio file while streaming it with AVPlayer | |
// | |
#import "ViewController.h" | |
#import <AVFoundation/AVFoundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
int main(int argc, char **argv) | |
{ | |
@autoreleasepool | |
{ | |
void (^testBlock)(NSString *test) = | |
^(NSString *test) | |
{ | |
NSLog(@"%@", test); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Needs CoreImage.framework | |
- (UIImage *)blurredImageWithImage:(UIImage *)sourceImage{ | |
// Create our blurred image | |
CIContext *context = [CIContext contextWithOptions:nil]; | |
CIImage *inputImage = [CIImage imageWithCGImage:sourceImage.CGImage]; | |
// Setting up Gaussian Blur | |
CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)stringWithFormat:(NSString *)format args:(NSArray *)args | |
{ | |
NSMutableData *data = [NSMutableData dataWithLength:(sizeof(id) * args.count)]; | |
[args getObjects:(__unsafe_unretained id *)data.mutableBytes range:NSMakeRange(0, args.count)]; | |
NSString *so = [[NSString alloc] initWithFormat:format arguments:data.mutableBytes]; | |
return so; | |
} |
NewerOlder