Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Based on https://www.degeneratestate.org/posts/2016/Oct/23/image-processing-with-numpy/ | |
import numpy as np | |
import matplotlib.pylab as plt | |
import matplotlib.gridspec as gridspec | |
%matplotlib inline | |
original = plt.imread("mona_lisa_full.jpg") |
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
// Demonstrates how to trace a path using SKShapeNode, CGMutablePath and Update | |
// Swift 4.0 | |
import SpriteKit | |
import PlaygroundSupport | |
import AVFoundation | |
let start = CGPoint(x: 100, y: 50) | |
let end = CGPoint(x: 200, y: 50) | |
let control = CGPoint(x: 150, y: 100); | |
var motion: SKAction = SKAction(); |
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
// Arrowhead pointing in the direction of "towards" CGPoint - supports triangular, pointy and diamond shaped heads as well | |
// | |
// Based on https://gist.github.com/mayoff/4146780// | |
// | |
import UIKit | |
class ArrowHeadPath { | |
class func create(from start: CGPoint, towards end: CGPoint, width: CGFloat, headLengthOuter: CGFloat, headLengthInner: CGFloat) -> CGPath { |
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 | |
import PlaygroundSupport | |
let bounds = CGRect(x: 0, y: 0, width: 400, height: 200) | |
let uiview = UIView(frame: bounds) | |
uiview.backgroundColor = UIColor.clear | |
PlaygroundPage.current.liveView = uiview |