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
// | |
// ScrumData.swift | |
// Scrumdinger | |
// | |
// Created by Jamie Pinkham on 12/15/20. | |
// | |
import SwiftUI | |
import Combine |
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
//curries a 2 argument function | |
func curry<A, B, C>(_ f: @escaping (A, B) -> C) -> (A) -> (B) -> C { | |
return { x -> (B) -> C in { y -> C in | |
f(x, y) | |
} | |
} | |
} | |
func add(x: Int, y: Int) -> Int { | |
return x + y |
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
enum MyError: Error { | |
case whoops | |
} | |
//Observable.create {} | |
let o = AnyPublisher<Int, MyError> { subscriber in | |
/* | |
onNext, but in combine you are returned a demand, | |
this is for controlling backpressure, which | |
doesn't exist in RxSwift. |
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
protocol Action { } | |
protocol State { | |
static var initial: Self { get } | |
} | |
typealias Reducer<S: State, A: Action> = (_ state: S, _ action: A) -> S | |
enum AnAction: Action { } | |
enum AState: State { | |
case none |
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
struct IntBox: CustomDebugStringConvertible { | |
let int: Int | |
init(int: Int) { | |
self.int = int | |
} | |
var debugDescription: String { | |
return "Intbox: \(self.int)" | |
} | |
} |
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
var str = "Hello, playground" | |
enum Transformer<T> { | |
typealias Transform = NSData -> T?; | |
} | |
let data = str.dataUsingEncoding(NSUTF8StringEncoding)! | |
let transformer = Transformer<String>.Transform { data in return String(data: data, encoding: NSUTF8StringEncoding) } |
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
// | |
// UBCoreDataStack.h | |
// LevelDBMigrator | |
// | |
// Created by Jamie Pinkham on 1/28/14. | |
// Copyright (c) 2014 Jamie Pinkham. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
#!/usr/bin/python | |
import sys | |
import os, shutil | |
import subprocess | |
import os.path | |
from datetime import datetime | |
import time | |
######################## Functions ######################### |
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
NSDictionary *viewsDict = NSDictionaryOfVariableBindings(_viewToAnimate); | |
NSLayoutConstraint *animationConstraint = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(3)-[_viewToAnimate]" options:0 metrics:nil views:viewsDict][0]; | |
[self.containerView removeConstraint:self.leftEdgeConstraint]; | |
[self.containerView addConstraint:animationConstraint]; | |
[UIView animateWithDuration:0.3 animations:^{ | |
[self.view layoutIfNeeded]; | |
} completion:^(BOOL finished) { | |
; | |
}]; |
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
// | |
// JPSubscriptedCache.m | |
// | |
// | |
// Created by Jamie Pinkham on 5/14/13. | |
// | |
// | |
#import "JPSubscriptedCache.h" |
NewerOlder