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
- (NSManagedObjectContext*)managedObjectContext { | |
if (_managedObjectContext) { | |
return _managedObjectContext; | |
} | |
NSManagedObjectModel* managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil]; | |
NSPersistentStoreCoordinator* persistantStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:managedObjectModel]; | |
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);; |
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
[connection sendDidRecieveData:[@"[{\"id\": 1, \"text\": \"object0\", \"created_at\": \"Sat Aug 20 12:34:56 +0000 2011\", \"user\": {\"id\":\"1\", \"screen_name\": \"testuser0\"} }]" dataUsingEncoding:NSUTF8StringEncoding]]; |
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
$(document).ready(function() { | |
$('input[name="hoge"]:radio').change(function() { | |
if ($(this).val() == 'piyo') { | |
$('input[name="fuga"]:checkbox').removeAttr('disabled'); | |
} | |
else { | |
$('input[name="fuga"]:checkbox').attr('disabled', 'disabled'); | |
} | |
}); | |
}); |
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
sudo pear upgrade PEAR | |
sudo pear channel-discover pear.phpunit.de | |
sudo pear config-set auto_discover 1 | |
sudo pecl install xdebug | |
sudo pear install pear.phpunit.de/PHPUnit |
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
int kotoko() { | |
if (hoge) { | |
if (fuga) { | |
if (piyo) { | |
if (is18years_old) { | |
hiwai(); | |
} | |
else { | |
kimoi(); | |
} |
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
2011-11-10 05:55:33 +0000: (null) | |
2011-11-10 05:55:33 +0000: account/verify_credentials.json?include_entities=1 | |
2011-11-10 05:55:33 +0000: (null) | |
2011-11-10 05:55:34 +0000: GET | |
2011-11-10 05:55:34 +0000: blocks/blocking/ids.json | |
2011-11-10 05:55:34 +0000: (null) | |
2011-11-10 05:55:34 +0000: GET | |
2011-11-10 05:55:34 +0000: friendships/no_retweet_ids.json | |
2011-11-10 05:55:34 +0000: (null) | |
2011-11-10 05:55:34 +0000: (null) |
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
curl "https://api.twitter.com/statuses/user_timeline.json?screen_name=poyow&include_rts=1&include_entities=1&count=100" | |
{"error":"Rate limit exceeded. Clients may not make more than 150 requests per hour.","request":"\/statuses\/user_timeline.json?screen_name=poyow&include_rts=1&include_entities=1&count=100"} |
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
defencoding UTF-8 | |
escape ^Z^Z | |
hardstatus alwayslastline "%`%-w%{=b bw}%n %t%{-}%+w" | |
defscrollback 100000 |
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
// managedObjectModelからFetchedPropertyを検索し、ソート条件を追加 | |
// NSPersistentStoreCoordinatorを作成する前に行うこと! | |
for (NSEntityDescription* entity in [managedObjectModel entities]) { | |
for (NSPropertyDescription* property in [entity properties]) { | |
if ([property isKindOfClass:[NSFetchedPropertyDescription class]]) { | |
NSFetchedPropertyDescription* fetchedProperty = (NSFetchedPropertyDescription*) property; | |
NSFetchRequest* fetchRequest = [fetchedProperty fetchRequest]; | |
if ([[[[fetchRequest entity] propertiesByName] allKeys] containsObject:@"twId"]) { | |
NSSortDescriptor* sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"twId" ascending:NO] autorelease]; |
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 NSDictionary (isNull) | |
- (BOOL)isNull:(id)aKey | |
{ | |
id value = [self objectForKey:aKey]; | |
return (value == nil || [value isEqual:[NSNull null]]); | |
} | |
@end |
OlderNewer