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 / 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);
}];
@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 / 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 / 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 / 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 / ViewPagerTabs.swift
Last active April 20, 2016 16:45
An iOS version of the tabs used with Android's view pager, based on a UISegmentedControl
//
// ViewPagerTabs.swift
//
// Created by jesse calkin on 3/14/16.
// Copyright © 2016 Shoshin Boogie. All rights reserved.
//
import UIKit
class ViewPager: UISegmentedControl {
import UIKit
import XCPlayground
let page = XCPlaygroundPage.currentPage
let view = UIView(frame: CGRect(x: 0, y: 0, width: 750, height: 750))
page.liveView = view
let position = CGPoint(x: 0, y: 0)
//
// DonutView.swift
//
// Created by jesse calkin on 3/15/16.
// Copyright © 2016 jesse calkin. All rights reserved.
//
import UIKit
func percentToRadians(percent: CGFloat) -> CGFloat {
@Jesse-calkin
Jesse-calkin / color_management.md
Created March 23, 2016 19:46
Color Management

Color Management

Base Colors

public struct Colors {
    public static let blue1 = UIColor(red: 0.0, green: 0.0, blue: 1.0, alpha: 1.0)
    public static let blue2 = UIColor(red: 0.0, green: 0.4, blue: 1.0, alpha: 1.0)
    public static let blue3 = UIColor(red: 0.1, green: 0.0, blue: 1.0, alpha: 1.0)
 public static let blue4 = UIColor(red: 0.2, green: 0.2, blue: 1.0, alpha: 1.0)
@Jesse-calkin
Jesse-calkin / UIMotionEffectExtensions.swift
Created March 31, 2016 04:01
UIMotionEffect Extensions
//
// UIMotionEffectExtensions.swift
// Collection Views
//
// Created by jesse calkin on 3/30/16.
// Copyright © 2016 Shoshin Boogie. All rights reserved.
//
import UIKit