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
| NSString * const MYFoo = @"foo"; | |
| NSString * const MYBar = @"bar"; | |
| @implementation Baz | |
| + (NSDictionary *)metaSyntacticTypes { | |
| static NSDictionary *_metaSyntacticTypes = nil; | |
| if (_metaSyntacticTypes == nil) { | |
| _metaSyntacticTypes = [NSDictionary dictionaryWithObjectsAndKeys: | |
| @"foo", MYFoo, |
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
| # Hostname | |
| curl -s http://169.254.169.254/latest/meta-data/public-hostname | |
| # IP | |
| curl -s http://169.254.169.254/latest/meta-data/public-ipv4 |
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
| knife ec2 server list | tail -n1 | cut -f1 -d' ' | xargs knife ec2 server delete -y |
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
| echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config |
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
| # Reminder: | |
| class Object | |
| def let | |
| yield self | |
| end | |
| end | |
| class Object | |
| def tap |
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
| # EC2 Magic, WTF | |
| `curl http://169.254.169.254/latest/meta-data/public-ipv` |
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
| def foo | |
| bar == "some value test" ? | |
| "#{self.baz} some relevant but shitty string that takes up way too many characters" : | |
| "#{self.baz} some other equally relevant and shitty string" | |
| end |
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)setupHeader { | |
| NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"PlanHeaderLabel" owner:self options:nil]; | |
| PlanHeaderLabel *planHeaderLabel = [topLevelObjects objectAtIndex:0]; | |
| [planHeaderLabel updateWithPlan:self.plan]; | |
| self.myTableView.tableHeaderView = planHeaderLabel; | |
| // Need to adjust the scroll window | |
| UIEdgeInsets insets = UIEdgeInsetsMake(0, 0, self.myTableView.tableHeaderView.frame.size.height, 0); | |
| self.myTableView.contentInset = insets; | |
| self.myTableView.scrollIndicatorInsets = insets; |
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
| NSArray *sorted = [self.buy.placements sortedArrayUsingComparator:^(id a, id b) { | |
| return [[(Placement *)a position] compare:[(Placement *)b position]]; | |
| }]; | |
| self.buy.placements = [NSMutableArray arrayWithArray:sorted]; |
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
| NSSortDescriptor *descriptor = [[[NSSortDescriptor alloc] initWithKey:@"key" ascending:YES] autorelease]; | |
| [array sortUsingDescriptors:[NSArray arrayWithObjects:descriptor,nil]]; |