- Swift
- Objective-C
- C++/C
- JavaScript
- Mac OSX
- iOS
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| // | |
| // UIView+frameAdjust.h | |
| // fenbi | |
| // | |
| // Created by Tang Qiao on 12-5-31. | |
| // Copyright (c) 2012年 Fenbi.com . All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> |
| - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext | |
| { | |
| UIView *container = transitionContext.containerView; | |
| UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; | |
| UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; | |
| UIView *fromView = fromVC.view; | |
| UIView *toView = toVC.view; | |
| CGRect beginFrame = CGRectMake(UI_SCREEN_WIDTH, 0, UI_SCREEN_WIDTH, UI_SCREEN_HEIGHT); |
| var flag = []; | |
| var ans = []; | |
| function solve(idx) { | |
| if (idx == 5) { | |
| console.log(ans.join('')); | |
| return; | |
| } | |
| for (var i = 1; i <= 6; ++i) { | |
| if (!flag[i]) { | |
| flag[i] = true; |
| #!/bin/bash | |
| # Get the tracking branch (if we're on a branch) | |
| TRACKING_BRANCH=`git svn info | grep URL ` | |
| # If the tracking branch has 'URL' at the beginning, then the sed wasn't successful and | |
| # we'll fall back to the svn-remote config option | |
| if [[ "$TRACKING_BRANCH" =~ URL.* ]] | |
| then |
| + (ImageCache *) sharedInstance { | |
| if (instance == nil) { | |
| @synchronized(self) { | |
| if (instance == nil) { | |
| instance = [[ImageCache alloc] init]; | |
| } | |
| } | |
| } | |
| return instance; | |
| } |