Skip to content

Instantly share code, notes, and snippets.

@ajayjapan
ajayjapan / gist:5e7ba49e51f1ca24b76d
Created August 28, 2014 18:16
Adjust content size of collection view when flexible iOS 8 simulator size changes
@interface UICollectionViewFlowLayout (InvalidateOnBoundsChange)
@end
@implementation UICollectionViewFlowLayout (InvalidateOnBoundsChange)
- (UICollectionViewLayoutInvalidationContext *)invalidationContextForBoundsChange:(CGRect)newBounds {
UICollectionViewLayoutInvalidationContext *context = [super invalidationContextForBoundsChange:newBounds];
CGRect oldBounds = self.collectionView.bounds;
CGFloat widthAdjustment = newBounds.size.width - oldBounds.size.width;
// AFIncrementalStore.m
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@ajayjapan
ajayjapan / gist:3456708
Created August 24, 2012 22:48
Super quick hack to fix recursive json object mapping
// AFIncrementalStore.m
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
bash-3.2$ cucumber
Feature: Test
Background: # features/example.feature:3
Given "sonar.xcodeproj" is loaded in the simulator # iCuke-0.6.3/lib/icuke/cucumber.rb:197
execution expired (Timeout::Error)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:60:in `launch'
features/example.feature:4:in `Given "sonar.xcodeproj" is loaded in the simulator'
Scenario: User views the About screen # features/example.feature:6
@ajayjapan
ajayjapan / Reformatting JSON
Created January 19, 2011 20:41
Input & Output
Input: {
"venues": [{
"name": "Grand Central Terminal",
"type": "Trending Now"
},
{
"name": "New York Penn Station",
"type": "Trending Now"
},
{
@ajayjapan
ajayjapan / RVM issue
Created January 12, 2011 03:10
cinderella
bash-3.2$ rm -rf ~/Developer
bash-3.2$ open http://www.atmos.org/cinderella/
bash-3.2$ curl https://github.com/atmos/cinderella/raw/master/bootstrap.sh \
> -o - | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
102 1333 102 1333 0 0 3772 0 --:--:-- --:--:-- --:--:-- 33325
Ensuring we have the latest version of cinderella installed
A first time install takes about 45 minutes on a modern machine
Password: