Skip to content

Instantly share code, notes, and snippets.

View 0xjorgev's full-sized avatar

Jorge Mendoza 0xjorgev

View GitHub Profile
import turicreate as tc
# Load the style and content images
styles = tc.load_images('style/')
content = tc.load_images('content/')
# Create a StyleTransfer model
model = tc.style_transfer.create(styles, content)
# Load some test images
@0xjorgev
0xjorgev / Swift Functions Part One.swift
Created May 23, 2015 21:59
Swift Functions Part One
import UIKit
/*
Swift Functions on theswift.ninja!
http://www.theswift.ninja/swift/
*/
//Function of type Void (doesn't not return nothing)
@0xjorgev
0xjorgev / Swift-Programming-Language-Quick-Reference-Guide.md
Last active July 19, 2016 20:35
Swift Programming Language Quick Reference Guide

Swift Programming Language Quick Reference Guide

 The Swift Programming Language was launch on June 2, 2014 in the Apple WWDC. Since that very same day i started trying this new, modern, simple to read and complex to learn programming language.

 This will be a quick reference guide for Swift. Let's start by describing the basic things first.

Variables in Swift

Variables are values and objects containers in the Swift Programming Language, variables are declared using the let reserved word for constants and var for mutable ones, lets see some variables examples. ```swift

//Implicit inmutable variable let dojoNinjas = 1

@0xjorgev
0xjorgev / QuickReferencePlayground.swift
Last active March 30, 2017 04:20
This is a Quick Swift Reference Guide for TheSwift.ninja
// Playground - noun: a place where people can play
import Foundation
import UIKit
//Implicit inmutable variable
let dojoNinjas = 1
//Implicit mutable variable
var ninjaApprentices = 1500
enum ClientType {
case regularK
case premiumK
}
class TSNClient1: NSObject {
var clientId:Int
var name:String
import Foundation
class TSNClient: NSObject {
var clientId:Int
var name:String
var lastName:String
var email:String
var mailAddress:String
@0xjorgev
0xjorgev / AppDelegate.m
Created October 31, 2014 21:38
Parse.com PushNotification AppDelegate.m Updated for iOS 8
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// ****************************************************************************
// Uncomment and fill in with your Parse credentials:
[Parse setApplicationId:@"YOUR-CLIENT-KEY" clientKey:@"YOUR-APP-KEY"];
// ****************************************************************************
// Override point for customization after application launch.
//This won't work for iOS 8 or Superior
function getAverageColourAsRGB (img) {
var canvas = document.createElement('canvas'),
context = canvas.getContext && canvas.getContext('2d'),
rgb = {r:102,g:102,b:102}, // Set a base colour as a fallback for non-compliant browsers
pixelInterval = 5, // Rather than inspect every single pixel in the image inspect every 5th pixel
count = 0,
i = -4,
data, length;
// return the base colour for non-compliant browsers