Skip to content

Instantly share code, notes, and snippets.

View Jesse-calkin's full-sized avatar

Jesse Jesse-calkin

  • Comcast VIPER
  • Denver, CO
View GitHub Profile
@Jesse-calkin
Jesse-calkin / String+Reverse.swift
Last active March 4, 2016 21:33
String extension adding a reverse function
extension String {
func reverse() -> String {
guard self.characters.count > 1 else { return self }
var reversed = ""
for char in self.characters.reverse() {
reversed += "\(char)"
}
@Jesse-calkin
Jesse-calkin / UIBezierPath+Shapes.swift
Last active March 2, 2018 01:12
UIBezierPath extension adding convenience initializers for basic shapes.
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)
}
@Jesse-calkin
Jesse-calkin / Core Animation + UIKit Dynamics
Created May 19, 2015 14:37
Core Animation + UIKit Dynamics
//
// ViewController.swift
// Animation Sandbox
//
// Created by Jesse Calkin on 5/18/15.
// Copyright (c) 2015 Shoshin Boogie. All rights reserved.
//
import UIKit
@Jesse-calkin
Jesse-calkin / BPNN.py
Created April 16, 2014 14:44
Example of back-propagating neural network in Python
# 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
@Jesse-calkin
Jesse-calkin / logAllNotifications.m
Last active October 18, 2021 20:09
NSLog notifications from App Delegate: http://jessecalkin.com/code-test/
[[NSNotificationCenter defaultCenter] addObserverForName:nil
object:nil
queue:nil
usingBlock: ^(NSNotification *notification) {
NSLog(@"Received Notification:\n%@\n%@",
notification.name,
notification.userInfo);
}];