###View Transitions in iOS 7
This file contains hidden or 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
| class GroupersController < ApplicationController::Base | |
| def create | |
| @grouper = Grouper.new(leader: current_member) | |
| if @grouper.save | |
| ConfirmedGrouperEmails.new(@grouper).deliver | |
| AssignBarForGrouper.enqueue(@grouper.id) | |
| redirect_to home_path | |
| else |
This file contains hidden or 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
| class GroupersController < ApplicationController::Base | |
| def create | |
| @grouper = Grouper.new(leader: current_member) | |
| if @grouper.save | |
| confirm_grouper_via_emails(@grouper) | |
| enqueue_bar_assignment(@grouper) | |
| redirect_to home_path | |
| else |
This file contains hidden or 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
| NSTimeInterval duration = 3.0; | |
| SEL selector = @selector(_setContentOffsetAnimationDuration:); | |
| NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[scrollView methodSignatureForSelector:selector]]; | |
| [invocation setSelector:selector]; | |
| [invocation setTarget:scrollView]; | |
| [invocation setArgument:&duration atIndex:2]; | |
| [invocation invoke]; | |
| [scrollView setContentOffset:contentOffset animated:YES] |
Some notes on why Go works for me and why it might work for you if you're looking for another language to add to your repetoire. Goes without saying that this reflects my personal taste.
Go features that I particularly like
- Multicore is the future so I like that Go has concurrency built right into the core. Goroutines and channels provide a very accessible metaphor for thinking about concurrent programming. They're supported by language features that really make Go shine in this area. The select statement, for example, makes it easy to listen to and synchronise events from different concurrent threads.
- Provides both pointers and value types, but the pointers are safe and managed. Automatic memory management means its safe to return a pointer to a local variable.
- Interfaces in Go are smooth and unobtrusive. They automatically apply to anything with the right function signature so you can define interfaces that are satisfied by 3rd party code without you having to change it.
- Errors are signale
This file contains hidden or 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
| - (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) | |
| { |
This file contains hidden or 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
| + (void)describePreferredFonts | |
| { | |
| static NSArray *textStyles; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| textStyles = @[UIFontTextStyleHeadline, | |
| UIFontTextStyleSubheadline, | |
| UIFontTextStyleBody, | |
| UIFontTextStyleFootnote, | |
| UIFontTextStyleCaption1, |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
This file contains hidden or 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
| gem 'foreman' | |
| gem 'puma' |