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
let defaults = NSUserDefaults.standardUserDefaults() | |
self.window = UIWindow(frame: UIScreen.mainScreen().bounds) | |
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) | |
if !defaults.boolForKey("initialLaunch") { | |
defaults.setBool(true, forKey: "initialLaunch") | |
self.window?.rootViewController = mainStoryboard.instantiateViewControllerWithIdentifier("IntroductionViewController") as! IntroductionViewController | |
} else { | |
self.window?.rootViewController = mainStoryboard.instantiateViewControllerWithIdentifier("SecondViewController") as! SecondViewController | |
} |
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
override func layoutAttributesForElementsInRect(rect: CGRect) -> [AnyObject]? { | |
var answer = super.layoutAttributesForElementsInRect(rect) | |
for i in 1..<answer!.count { | |
let currentLayoutAttributes: UICollectionViewLayoutAttributes = answer![i] as! UICollectionViewLayoutAttributes | |
let prevLayoutAttributes: UICollectionViewLayoutAttributes = answer![i-1] as! UICollectionViewLayoutAttributes | |
let maximumSpacing = 4 | |
let origin = Int(CGRectGetMaxX(prevLayoutAttributes.frame)) | |
if((origin + maximumSpacing + Int(currentLayoutAttributes.frame.size.width)) < Int(self.collectionViewContentSize().width)) { |
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
log_formatter = logging.Formatter(log_format, datefmt=log_date_format) | |
log_handler.setFormatter(log_formatter) | |
worker_logger = logging.getLogger('worker') | |
worker_fh = logging.FileHandler(filename + '.log', mode='a') | |
worker_fh.setFormatter(log_formatter) | |
worker_logger.setLevel(logging.INFO) | |
worker_logger.addHandler(worker_fh) | |
structured_logger = logging.getLogger('structured') |
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
var $time = Date.now || function(){ | |
return +new Date(); | |
}; | |
function $unlink(object){ | |
var unlinked; | |
if (typeof (object) === "object") { | |
unlinked = {}; | |
for (var p in object) unlinked[p] = $unlink(object[p]); | |
} 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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
... | |
// Request remote notification authorization | |
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; | |
... | |
} | |
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { | |
NSString *deviceTokenString = [[[[deviceToken description] |
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
#0 0x00007fff85dbc5f0 in object_getClass () | |
#1 0x0000000100154214 in rb_objc_convert_immediate () | |
#2 0x0000000103302b5e in <????> () | |
#3 0x000000010331bdb0 in <????> () | |
#4 0x0000000100031a43 in -[SRRecorderControl shortcutRecorderCell:keyComboDidChange:] at /Users/eric/Development/TT/SRRecorderControl.m:344 | |
#5 0x000000010002dad5 in -[SRRecorderCell performKeyEquivalent:] () | |
#6 0x0000000100030dfe in -[SRRecorderControl performKeyEquivalent:] () | |
#7 0x00007fff86947f57 in -[NSControl _performKeyEquivalent:conditionally:] () | |
#8 0x00007fff86947e1f in -[NSView performKeyEquivalent:] () | |
#9 0x00007fff86947e1f in -[NSView performKeyEquivalent:] () |
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
<div> <br/><br/><span style="font-size:medium">We solve mobile problems</span><br/><span style="font-size:medium">for </span><span style="font-size:medium"><span style="color:#ff5400;">advertisers</span></span><span style="font-size:medium">, </span><span style="font-size:medium"><span style="color:#ff5400;">developers</span></span><span style="font-size:medium">,</span><br/><span style="font-size:medium">and </span><span style="font-size:medium"><span style="color:#ff5400;">users</span></span><span style="font-size:medium">.</span><br/><br/><a href="/gwt/x?source=wax&u=http%3A%2F%2Fkappboom.com/index.html&wsi=796f4ee2360ce6b9&ei=K8tVTfK3HZHsxQWsuMWNDQ&wsc=yq">HOME</a> <a href="/gwt/x?source=wax&u=http%3A%2F%2Fkappboom.com/about.html&wsi=796f4ee2360ce6b9&ei=K8tVTfK3HZHsxQWsuMWNDQ&wsc=yq">ABOUT</a> <a href="/gwt/x?source=wax&u=http%3A%2F%2Fkappboom.com/career.html&wsi=796f4ee2360ce6b9&ei=K8tVTfK3HZHsxQWsuMWNDQ&wsc=yq">CAREERS</a> <a href="/gwt/x?source=wax&a |
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
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"foo == 24"]; | |
NSLog(@"%@", predicate); | |
predicate = [NSPredicate predicateWithFormat:@"%@ == 24", @"foo"]; | |
NSLog(@"%@", predicate); | |
------- | |
2010-12-01 18:40:47.753 Test[19006:207] foo == 24 | |
2010-12-01 18:40:47.754 Test[19006:207] "foo" == 24 |
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
<?xml version='1.0' encoding='UTF-8' ?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:ui="http://java.sun.com/jsf/facelets" | |
xmlns:h="http://java.sun.com/jsf/html" | |
xmlns:f="http://java.sun.com/jsf/core"> | |
<ui:composition template="/comicReaderTemplate.xhtml"> | |
<ui:define name="top"> | |
<div>Sync Button</div> | |
<div>Add Comic Button</div> |
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 MyAwesomeController < ApplicationController | |
def new | |
@user_session = UserSession.new | |
end | |
def create | |
@user_session = UserSession.new(params[:user_session]) | |
if @user_session.save | |
flash[:notice] = "Logged in" | |
redirect_to root_url |