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
//yahoo weather | |
NSLog(@"%@", [YahooAPI yahooAPIWeatherWithWOEID:@"12703518"]); | |
NSLog(@"%@", [YahooAPI yahooAPIWeatherWithWOEID:@"12703518" unit:YAHOO_WEATHER_UNIT_CELSIUS]); | |
NSLog(@"%@", [YahooAPI yahooAPIWeatherWithWOEID:@"12703518" unit:YAHOO_WEATHER_UNIT_FAHRENHEIT]); | |
//yahoo woeid | |
NSLog(@"%@", [YahooAPI yahooAPIWOEIDWithLatitude:25.049826 Longitude:121.572586]); | |
NSLog(@"%@", [YahooAPI yahooAPIWOEIDWithAddress:@"台北市大安區敦化南路二段267號"]); |
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) grantAddressBook{ | |
// Request authorization to Address Book | |
ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, NULL); | |
if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) { | |
ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) { | |
// First time access has been granted, add the contact | |
[self getContentList:addressBookRef]; | |
}); | |
} |
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
#ifdef LITE | |
//lite version | |
//your code here | |
#else | |
//not lite version(i.e. pro) | |
//your code here | |
#endif | |
//------------------------------------------------------------- |
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
// | |
// CheckNetWork.h | |
// | |
// | |
// Created by Isken Huang on 11/13/10. | |
// Copyright 2010 Isken Huang. All rights reserved. | |
// | |
#import <netinet/in.h> | |
#import <SystemConfiguration/SCNetworkReachability.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
app.post('/upload', function(req, res){ | |
data = req.body; | |
// get the temporary location of the file | |
console.log('file => '+req.files); | |
var tmp_path = req.files.file.path; | |
// set where the file should actually exists - in this case it is in the "images" directory | |
var target_path = './public/images/'+ req.files.file.name; | |
// move the file from the temporary location to the intended location | |
console.log('tmp_path = '+tmp_path+' || target_path = '+target_path); |
NewerOlder