Skip to content

Instantly share code, notes, and snippets.

- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity
{
CGFloat offSetAdjustment = MAXFLOAT;
CGFloat horizontalCenter = (CGFloat) (proposedContentOffset.x + (self.collectionView.bounds.size.width / 2.0));
CGRect targetRect = CGRectMake(proposedContentOffset.x, 0.0, self.collectionView.bounds.size.width, self.collectionView.bounds.size.height);
NSArray *array = [self layoutAttributesForElementsInRect:targetRect];
for (UICollectionViewLayoutAttributes *layoutAttributes in array)
{
/*
Converts A class to a dictionary, used for serializing dictionaries to JSON
Supported objects:
- Serializable derived classes
- Arrays of Serializable
- NSData
- String, Numeric, and all other NSJSONSerialization supported objects
@rkeniger
rkeniger / gist:ee4c9e03873477e1d347
Last active October 13, 2015 23:30
Traceroute to secure.backblaze.com
Directly:
⚡ traceroute secure.backblaze.com
traceroute to secure.backblaze.com (162.244.59.9), 64 hops max, 52 byte packets
1 192.168.1.1 (192.168.1.1) 1.662 ms 2.092 ms 1.438 ms
2 10.223.192.1 (10.223.192.1) 9.944 ms 9.157 ms 9.862 ms
3 58.160.16.198 (58.160.16.198) 12.241 ms 9.967 ms 8.028 ms
4 58.160.23.226 (58.160.23.226) 10.402 ms 8.942 ms 9.956 ms
5 bundle-ether4.woo-edge902.brisbane.telstra.net (203.50.44.42) 11.666 ms 11.512 ms 9.805 ms
6 bundle-ether6.woo-core1.brisbane.telstra.net (203.50.11.138) 10.710 ms 13.832 ms 11.943 ms