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
/* | |
Usage | |
NSString *password = @"1111"; | |
NSString *message = @"xxx"; | |
NSData *inData = [message dataUsingEncoding:NSUTF8StringEncoding]; | |
NSData *encData = [securityUtils encryptPBEWithMD5AndDESData:inData password:password]; | |
NSString *encString = [encData base64EncodedString]; |
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.m | |
*/ | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
[[NSNotificationCenter defaultCenter] addObserverForName:NSManagedObjectContextDidSaveNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note){ | |
[self.managedObjectContext mergeChangesFromContextDidSaveNotification:note]; | |
}]; |
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
/* | |
* Test | |
*/ | |
function test(title, f, options) { | |
if (options == null) { | |
options = { | |
logTree: true | |
}; | |
} |
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
// | |
// NSAttributedString+fromHTML.m | |
// Berlingske | |
// | |
// Created by Taras Kalapun on 18.08.10. | |
// Copyright (c) 2010 Ciklum. All rights reserved. | |
// | |
#import "NSAttributedString+fromHTML.h" |
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
#!/usr/bin/env python | |
import socket | |
import sys | |
import random | |
import struct | |
import time | |
# Server example |
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
// Beta !! | |
- (NSArray *)widthForData:(NSArray *)dataArray | |
{ | |
if ([dataArray count] < 1) return nil; | |
CGFloat totalWidth = 0.0f; | |
UIFont *font = [UIFont systemFontOfSize:12.0f]; | |
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
#import <Foundation/Foundation.h> | |
@interface NSObject (AMAssociatedObjects) | |
- (void)associateValue:(id)value withKey:(void *)key; // Retains value. | |
- (id)associatedValueForKey:(void *)key; | |
@end |
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
#!/bin/bash | |
SDK='iphoneos' | |
CONFIGURATION='Release' | |
IDENTITY="iPhone Developer" | |
GIT_BINARY='git' | |
REMOTE_HOST='http://hal.ciklum.net' | |
#http://github.com/baz/ios-build-scripts/raw/master/generate_manifest.py | |
MANIFEST_SCRIPT='/usr/local/bin/generate_manifest.py' | |
WEB_DIR="/Users/$USER/web" |
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
#import <Foundation/Foundation.h> | |
#import "Item.h" // Core Data MO | |
// Synchronous parser ! Will lock thread ! | |
@interface ItemParser : NSObject <NSXMLParserDelegate> | |
@property (nonatomic, retain) NSManagedObjectContext *managedObjectContext; // MOC for newly created MO | |
@property (nonatomic, retain) Item *currentItem; |
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
#import <UIKit/UIKit.h> | |
@interface CDTableViewController : UITableViewController <NSFetchedResultsControllerDelegate> { | |
NSFetchedResultsController *fetchedResultsController_; | |
} | |
@property (nonatomic, retain) NSFetchedResultsController *fetchedResultsController; | |
- (void)reloadData; |
OlderNewer