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
extension String { | |
func reverse() -> String { | |
guard self.characters.count > 1 else { return self } | |
var reversed = "" | |
for char in self.characters.reverse() { | |
reversed += "\(char)" | |
} | |
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 | |
let TWO_PI = .pi * 2.0 | |
extension UIBezierPath { | |
static func triangle(p1: CGPoint, p2: CGPoint, p3: CGPoint) -> UIBezierPath { | |
return UIBezierPath(tri: p1, p2: p2, p3: p3) | |
} | |
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.swift | |
// Animation Sandbox | |
// | |
// Created by Jesse Calkin on 5/18/15. | |
// Copyright (c) 2015 Shoshin Boogie. All rights reserved. | |
// | |
import UIKit |
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
# Back-Propagation Neural Networks | |
# | |
# Written in Python. See http://www.python.org/ | |
# Placed in the public domain. | |
# Neil Schemenauer <[email protected]> | |
# | |
# Found here: http://stackoverflow.com/a/3143318 | |
import math | |
import random |
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
[[NSNotificationCenter defaultCenter] addObserverForName:nil | |
object:nil | |
queue:nil | |
usingBlock: ^(NSNotification *notification) { | |
NSLog(@"Received Notification:\n%@\n%@", | |
notification.name, | |
notification.userInfo); | |
}]; |
NewerOlder