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
from google.appengine.api import urlfetch | |
from google.appengine.api import xmpp | |
from google.appengine.ext import db | |
from google.appengine.ext import webapp | |
from google.appengine.ext.webapp.util import run_wsgi_app | |
from google.appengine.ext.webapp import xmpp_handlers | |
import base64 | |
import feedparser | |
import logging |
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
// Provides a device_scale class on iOS devices for scaling user | |
// interface elements relative to the current zoom factor. | |
// | |
// http://37signals.com/svn/posts/2407-device-scale-user-interface-elements-in-ios-mobile-safari | |
// Copyright (c) 2010 37signals. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
// | |
// NSString+FileTextEncodingAttribute.h | |
// Adapted from http://github.com/scrod/nv/blob/master/NSString_NV.m | |
// | |
#import <Foundation/Foundation.h> | |
#include <sys/xattr.h> | |
@interface NSString (FileTextEncodingAttribute) |
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
*.pbxproj -crlf -diff -merge |
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
// Disable | |
[[UIApplication sharedApplication] setIdleTimerDisabled:YES]; | |
// Enable | |
[[UIApplication sharedApplication] setIdleTimerDisabled:NO]; |
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
// Code taken from http://intelliobjects.com/ErnieSvehla/?p=123 | |
-(void)viewDidUnload { | |
self.label1 = nil; | |
self.label2 = nil; | |
self.view1 = nil; | |
self.textView1 = nil; | |
self.view2 = nil; | |
[super viewDidUnload]; | |
} |
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
- (void)hideLoadingDefaultViewDidStop | |
{ | |
loadingDefaultView.hidden = YES; | |
} | |
- (void)viewDidAppear:(BOOL)animated | |
{ | |
if (!loadingDefaultView.hidden) | |
{ | |
[UIView beginAnimations:@"Hide loading screen" context:nil]; |
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
NSFetchRequest *request = [[NSFetchRequest alloc] init]; | |
NSEntityDescription *entity = [NSEntityDescription entityForName:@"YourEntityName" inManagedObjectContext:managedObjectContext]; | |
[request setEntity:entity]; | |
// retrive the objects with a given value for a certain property | |
NSPredicate *predicate = [NSPredicate predicateWithFormat: @"property == %@", value]; | |
[request setPredicate:predicate]; | |
// Edit the sort key as appropriate. | |
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"yourSortKey" ascending:YES]; | |
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; |
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
- (void) deleteAllObjects: (NSString *) entityDescription { | |
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; | |
NSEntityDescription *entity = [NSEntityDescription entityForName:entityDescription inManagedObjectContext:_managedObjectContext]; | |
[fetchRequest setEntity:entity]; | |
NSError *error; | |
NSArray *items = [_managedObjectContext executeFetchRequest:fetchRequest error:&error]; | |
[fetchRequest release]; | |
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
@implementation UINavigationBar(Background) | |
-(void)drawRect:(CGRect)rect{ | |
UIImage *navBgImage = [UIImage imageNamed:@"nav_bg.jpg"]; | |
[navBgImage drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; | |
} | |
@end |
OlderNewer