I hereby claim:
- I am epau on github.
- I am epau (https://keybase.io/epau) on keybase.
- I have a public key ASAZm-NmA8hUAy1NWRAPOFkgJIRbnAK4QbGgNpXUU4nrOgo
To claim this, I am signing this object:
var scrollDirection: UICollectionView.ScrollDirection | |
var interSectionSpacing: CGFloat | |
var boundarySupplementaryItems: [NSCollectionLayoutBoundarySupplementaryItems] |
// Input: [["A1", "A2", "A3"], ["B1", "B2", "B3", "B4"], ["C1", "C2"]] | |
// Output: ["A1", "B1", "C1", "A2", "B2", "C2", "A3", "B3", "B4"] | |
extension Collection where Element: Collection { | |
func zipped() -> [Element.Element] { | |
var result: [Element.Element] = [] | |
var iterators = map { $0.makeIterator() } | |
let total = reduce(0) { $0 + $1.count } | |
while result.count < total { | |
for (index, iterator) in iterators.enumerated() { |
I hereby claim:
To claim this, I am signing this object:
extension MGLCoordinateBounds { | |
// Clamps by shifting and maintaing distance aka diff between ne.latitude and sw.latitude will remain the same | |
mutating func clamp(to bounds: MGLCoordinateBounds) { | |
// Clamp latitude | |
let neLatitudeDiff = ne.latitude - bounds.ne.latitude | |
if neLatitudeDiff > 0 { | |
ne.latitude = bounds.ne.latitude | |
sw.latitude = sw.latitude - neLatitudeDiff | |
} else { | |
let swLatitudeDiff = bounds.sw.latitude - sw.latitude |
class Button: UIButton { | |
var onTap: (() -> ())? | |
init() { | |
super.init(frame: .zero) | |
} | |
required init?(coder aDecoder: NSCoder) { | |
super.init(frame: .zero) |
- (void)observeNumberOfUnreadMessages | |
{ | |
LYRQuery *query = [LYRQuery queryWithQueryableClass:[LYRMessage class]]; | |
query.predicate = [LYRPredicate predicateWithProperty:@"isUnread" predicateOperator:LYRPredicateOperatorIsEqualTo value:@(YES)]; | |
LYRQueryController *controller = [self.layerManager.layerClient queryControllerWithQuery:query]; | |
controller.delegate = self; | |
self.unreadMessagesQueryController = controller; | |
} | |
#pragma mark - LYRQueryController Delegate |
CLGeocoder *geocoder = [[CLGeocoder alloc] init]; | |
[geocoder geocodeAddressString:@"Piccadilly Circus, London, UK" | |
completionHandler:^(NSArray *placemarks, NSError *error) { | |
// Convert the CLPlacemark to an MKPlacemark | |
// Note: There's no error checking for a failed geocode | |
CLPlacemark *geocodedPlacemark = [placemarks objectAtIndex:0]; | |
MKPlacemark *placemark = [[MKPlacemark alloc] | |
initWithCoordinate:geocodedPlacemark.location.coordinate | |
addressDictionary:geocodedPlacemark.addressDictionary]; |
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Robot</title> | |
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> | |
<style> | |
.btn{width:96px; height:96px;} | |
.active{background-color: #afe123;} | |
</style> |