Skip to content

Instantly share code, notes, and snippets.

View iksnae's full-sized avatar

K Mills iksnae

View GitHub Profile
@iksnae
iksnae / Appfile
Created January 25, 2017 00:31 — forked from mmazzarolo/Appfile
Simple Fastlane setup for React-Native (Android - iOS)
# iOS
app_identifier "com.myapp.app" # The bundle identifier of your app
apple_id "[email protected]" # Your Apple email address
team_id "1234ABCD" # Developer Portal Team ID
# Android
json_key_file "./google-play-api-secret.json" # Path to the json secret file - Follow https://github.com/fastlane/supply#setup to get one
package_name "com.myapp.app" # Your Android app package
@iksnae
iksnae / install.sh
Created January 13, 2017 04:55 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
var https = require('https');
const endpoint = "https://spreadsheets.google.com/feeds/list/1DikXO7iDW8PjSE7GBIO-QJdVSXE7yiTuQ0MBwLBoGFM/od6/public/values?alt=json";
https.get(endpoint, function(res) {
var body = '';
res.setEncoding('utf8');
res.on('data', function(chunk) {
body += chunk;
});
extension UIImageView {
public func cachedImage(withURL url_string:String){
if let cached = ImageCache.shared.getImage(key: url_string) {
self.image = cached
}else{
guard let url = NSURL(string: url_string) else { return }
ImageCache.shared.fetchImage(url: url, callback: { (image) in
NSOperationQueue.main().addOperation({
self.image = image
})
class ImageCache {
static let shared = ImageCache()
let cache: NSCache<NSString,UIImage> = NSCache()
func addImage(key:String, image:UIImage) {
self.cache.setObject(image, forKey: key)
}
func getImage(key:String) -> UIImage? {
swift package init --type library
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
@iksnae
iksnae / gist:0e112060142da0c8dfc07b92e760b836
Created June 9, 2016 20:24
demo flask throwing error
docker-compose up --build
Building website
Step 1 : FROM python:2.7-slim
---> 035cf774b0b8
Step 2 : MAINTAINER Nick Janetakis <[email protected]>
---> Using cache
---> 0554b77eccd4
Step 3 : ENV INSTALL_PATH /snakeeyes
---> Using cache
---> 97e63342861a
@iksnae
iksnae / gist:84f7a562c122b2511c6e
Created May 5, 2014 18:30
UINavigationController changeViewController:animated
@interface UINavigationController (Extras)
- (void)changeViewController:(UIViewController *)viewController animated:(BOOL)animated;
@end
@implementation UINavigationController (Extras)
- (void)changeViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if ([self.childViewControllers containsObject:viewController]) {
@iksnae
iksnae / gist:b64437d5e7c2a7e20397
Created May 2, 2014 20:57
App Store View Controller
SKStoreProductViewController *productVC = [[SKStoreProductViewController alloc]init];
[productVC setDelegate:self];
NSDictionary *productParameters = @{ SKStoreProductParameterITunesItemIdentifier : @"708802884" };
[productVC loadProductWithParameters:productParameters completionBlock:^(BOOL result, NSError *error) {
//
[self dismissViewControllerAnimated:NO completion:nil];
if(error)
{
[[[UIAlertView alloc] initWithTitle:[error localizedDescription]