Skip to content

Instantly share code, notes, and snippets.

View dothework's full-sized avatar

Mark Carpenter dothework

  • Grand Rapids, Michigan, USA
View GitHub Profile
This file has been truncated, but you can view the full file.
{"traceEvents":[{"pid":81806,"tid":775,"ts":96972904591,"ph":"X","cat":"toplevel","name":"ThreadControllerImpl::RunTask","dur":5,"tdur":4,"tts":458688,"args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"}},
{"pid":81806,"tid":775,"ts":96972904534,"ph":"X","cat":"disabled-by-default-devtools.timeline","name":"RunTask","dur":102,"tdur":74,"tts":458650,"args":{}},
{"pid":81806,"tid":775,"ts":96972904647,"ph":"X","cat":"toplevel","name":"ThreadControllerImpl::RunTask","dur":3,"tdur":3,"tts":458735,"args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"}},
{"pid":81806,"tid":775,"ts":96972904644,"ph":"X","cat":"disabled-by-default-devtools.timeline","name":"RunTask","dur":10,"tdur":9,"tts":458732,"args":{}},
{"pid":81806,"tid":775,"ts":96972904679,"ph":"X","cat":"toplevel","name":"ThreadControllerImpl::RunTask","dur":3,"tdur":3,"tts":458767,"args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"}},
{"pid":81806,"tid":775,"ts":96972904676
@dothework
dothework / gist:ebd6904c206420bd4ee4
Created May 20, 2015 20:40
Back Button Code for Checkpoint #32
- (void) updateBackButton {
if ([self.webView canGoBack]) {
if (!self.navigationItem.leftBarButtonItem) {
[self.navigationItem setHidesBackButton:YES animated:NO];
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"< Login" style:UIBarButtonItemStylePlain target:self action:@selector(backButtonClicked)];
self.navigationItem.leftBarButtonItem = backButton;
}
} else {
[self.navigationItem setLeftBarButtonItem:nil animated:YES];
}
@dothework
dothework / gist:76f702a5ea166e48fdd3
Created May 19, 2015 00:36
Orange for the first comment only
- (NSAttributedString *) commentString {
NSMutableAttributedString *commentString = [[NSMutableAttributedString alloc] init];
BOOL bolFirst = YES;
for (Comment *comment in self.mediaItem.comments) {
// Make a string that says "username comment" followed by a line break
NSString *baseString = [NSString stringWithFormat:@"%@ %@\n", comment.from.userName, comment.text];
// Make an attributed string, with the "username" bold
NSMutableAttributedString *oneCommentString = [[NSMutableAttributedString alloc] initWithString:baseString attributes:@{NSFontAttributeName : lightFont, NSParagraphStyleAttributeName : paragraphStyle}];