This file contains 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
Factorial = (n) { | |
(y,f) { y.(f).(n) }.( | |
(le) { | |
(f) { f.(f) }.( | |
(f) { | |
le.(->(x) { f.(f).(x) }) | |
}) | |
}, | |
(recurse) { | |
(n) { (n==0) ? 1 : n * recurse.(n-1) } |
This file contains 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
// Assume array is an NSArray of NSString objects | |
NSString *lastFoo = nil; | |
for (NSString *foo in array) | |
{ | |
lastFoo = foo; // Why doesn't foo take on the address of bar? | |
lastFoo = &foo; // Is this better? | |
*lastFoo = &foo; // Or perhaps this? | |
// Other suggestions? |
This file contains 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
# git rebase -i head~n (where n is the number of commits from head you want) | |
# You will see something like this: | |
pick 907cdd8 Added new files to project | |
pick 8be0e96 Recent profile view pull to reload | |
# Rebase a1cd6ef..8be0e96 onto a1cd6ef | |
# | |
# Commands: |
This file contains 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
//============ AppDelegate =============== | |
@implementation AppDelegate | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
NSMutableArray *controllers = [NSMutableArray array]; | |
This file contains 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
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo"]]; | |
self.navigationItem.titleView = imageView; | |
[imageView setClipsToBounds:NO]; | |
imageView.layer.shadowOffset = CGSizeMake(4.0f, 4.0f); | |
imageView.layer.shadowOpacity = 1.0f; | |
imageView.layer.shadowColor = [UIColor blackColor].CGColor; |
This file contains 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
// UIBarButtonItem Appearance | |
NSMutableDictionary *barButtonItemAttributes = [NSMutableDictionary dictionary]; | |
[barButtonItemAttributes setValue:[UIFont fontWithName:@"AvenirNextCondensed-Regular" size:20.0] forKey:NSFontAttributeName]; | |
[[UIBarButtonItem appearance] setTitleTextAttributes:barButtonItemAttributes forState:UIControlStateNormal]; | |
[[UIBarButtonItem appearance] setTitleTextAttributes:barButtonItemAttributes forState:UIControlStateHighlighted]; |
This file contains 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
_assessmentListViewController = [[PMAssessmentListViewController alloc] initWithNibName:@"PMAssessmentListViewController" bundle:[NSBundle mainBundle]]; | |
[_assessmentListViewController setStudent:student]; | |
[_assessmentListViewController setAssessment:[[student classroom] assessment]]; | |
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:_assessmentListViewController]; | |
[navController setDelegate:self]; | |
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"done" style:UIBarButtonItemStylePlain target:self action:@selector(dismissTaskList:)]; | |
[[_assessmentListViewController navigationItem] setLeftBarButtonItem:doneButton]; | |
This file contains 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
CALayer *mask = [CALayer layer]; | |
mask.contents = (id)[[UIImage imageNamed:@"student_image_mask"] CGImage]; | |
mask.frame = CGRectMake(0, 0, 80, 80); | |
[imgView.layer setCornerRadius:40.0]; | |
[imgView.layer setBorderColor:[UIColor whiteColor].CGColor]; | |
[imgView.layer setBorderWidth:3.0]; | |
[imgView setBackgroundColor:[UIColor colorWithWhite:220.0/255.0 alpha:1.0]]; | |
imgView.layer.mask = mask; |