I hereby claim:
- I am marksands on github.
- I am marksands (https://keybase.io/marksands) on keybase.
- I have a public key ASCiHMudz2diWLv9Nu36oOAK8MPoacliJ3oPi89JfulWngo
To claim this, I am signing this object:
import UIKit | |
extension CGRect { | |
public static var unbounded: CGRect { | |
return CGRect(origin: .zero, size: .unbounded) | |
} | |
public var center: CGPoint { | |
return CGPoint(x: midX, y: midY) | |
} |
public protocol OptionalDateValueCodableStrategy { | |
associatedtype RawValue: Codable | |
static func decode(_ value: RawValue?) throws -> Date? | |
static func encode(_ date: Date?) -> RawValue? | |
} | |
@propertyWrapper | |
public struct OptionalDateValue<Formatter: OptionalDateValueCodableStrategy>: Codable { |
while true ; do sleep 15 && echo `date`‘ Capturing screenshot…’ && screencapture -C -m -t jpg -x -f cap.`date +%s`.jpg ; done |
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { | |
UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){ | |
// maybe show an action sheet with more options | |
[self.tableView setEditing:NO]; | |
}]; | |
moreAction.backgroundColor = [UIColor lightGrayColor]; | |
UITableViewRowAction *blurAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Blur" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){ | |
[self.tableView setEditing:NO]; | |
}]; |
I hereby claim:
To claim this, I am signing this object:
struct PerformActionSideEffect<Output, Failure: Error> { | |
private let publisher: AnyPublisher<Output, Failure> | |
init<P: Publisher>(_ publisher: P) where P.Output == Output, P.Failure == Failure { | |
self.publisher = publisher.eraseToAnyPublisher() | |
} | |
@discardableResult | |
func performSink(_ action: @escaping (Output) -> Void) -> PerformActionSideEffect { | |
publisher.subscribe( |
import PlaygroundSupport | |
import UIKit | |
import Foundation | |
import Vision | |
func part2layer() -> [String] { | |
let layers = Array(input).chunks(ofSize: 25 * 6) | |
var picture = Array(repeating: "2", count: 25 * 6) | |
layers.forEach { layer in |
enum Direction { | |
case up, down, left, right | |
} | |
protocol PositionType { | |
var x: Int { get } | |
var y: Int { get } | |
} | |
func euclideanDistance(_ lhs: PositionType, _ rhs: PositionType) -> Double { |
#include <vector> | |
#include <algorithm> | |
// ----------------------------------------------------------------------------- | |
// Function Object - print() | |
// ----------------------------------------------------------------------------- | |
namespace eds { | |
template <typename T> | |
struct print : public std::unary_function<T, void> { |