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
#pragma mark - 新浪微博mid与url互转 | |
-(NSArray*)str62keys | |
{ | |
return @[@"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9", | |
@"a",@"b",@"c",@"d",@"e",@"f",@"g",@"h",@"i",@"j",@"k",@"l",@"m",@"n",@"o",@"p",@"q",@"r",@"s",@"t",@"u",@"v",@"w",@"x",@"y",@"z", | |
@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z"]; | |
} | |
/** | |
* 62进制值转换为10进制 | |
* @param {NSString} str62 62进制值 |
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
1.To find which library is using uniqueidentifier method, go to your project folder and type in: | |
$ find . | grep -v .svn | grep "\.a" | grep -v "\.app" | xargs grep uniqueIdentifier |
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
function doesAppExist() { | |
// try to open iOS application | |
document.location = 'customiosappurl://'; | |
// if above failed, nothing happened | |
// set a timeout and do something else | |
!window.document.webkitHidden && setTimeout(function() { | |
setTimeout(function() { | |
window.location = '//apple.itunes.com/whatever' | |
}, 100); |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>App Redirection</title> | |
</head> | |
<body> | |
<!-- iframe used for attempting to load a custom protocol --> | |
<iframe style="display:none" height="0" width="0" id="loader"></iframe> |
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
Call removeTarget:action:forControlEvents: pass nil for the target, NULL for action, and use a control mask that sets all bits (UIControlEventAllEvents). Something like this: | |
[someControl removeTarget:nil | |
action:NULL | |
forControlEvents:UIControlEventAllEvents]; | |
https://developer.apple.com/library/ios/#documentation/uikit/reference/UIControl_Class/Reference/Reference.html | |
http://stackoverflow.com/questions/3340825/uibutton-remove-all-target-actions |
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
require 'rubygems' | |
require 'oauth' | |
require 'yaml' | |
CONSUMER_KEY = '' | |
CONSUMER_SECRET = '' | |
def get_access_token | |
p "get_access_token: Initializing Consumer" | |
consumer = OAuth::Consumer.new(CONSUMER_KEY, CONSUMER_SECRET, { |
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
OLD: | |
FMDatabase *db = [FMDatabase databaseWithPath:dbPath]; | |
… | |
[db executeUpdate:@"insert into namedparamtest values (:a, :b, :c, :d)" withParameterDictionary:dictionaryArgs]; | |
NEW: | |
FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:dbPath]; | |
… | |
[queue inDatabase:^(FMDatabase *db) { |
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
typedef enum { | |
kAccomplishmentTitleSection = 0, | |
kAccomplishmentCategorySection, | |
kNumberOfSections | |
} NESTemplateEditTableSections; | |
static NSString * const kCellIdentifiers[] = { | |
[kAccomplishmentTitleSection] = @"AccomplishmentTitleCell", | |
[kAccomplishmentCategorySection] = @"AccomplishmentCategoryCell" | |
}; |
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
CGFloat BNRTimeBlock (void (^block)(void)); |