copy and paste on Terminal.app
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublimefull document(https://gist.github.com/artero/1236170)
| 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); |
| // | |
| // 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> |
| #ifdef LITE | |
| //lite version | |
| //your code here | |
| #else | |
| //not lite version(i.e. pro) | |
| //your code here | |
| #endif | |
| //------------------------------------------------------------- |
| -(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]; | |
| }); | |
| } |
| //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號"]); |
| <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> | |
| <!-- Identify your business so that you can collect the payments. --> | |
| <input type="hidden" name="business" value="YOUR_PAYPAL_ACCOUNT"> | |
| <!-- code --> | |
| <input type="hidden" name="charset" value="utf-8"> | |
| <!-- Specify a Buy Now button. --> | |
| <input type="hidden" name="cmd" value="_xclick"> |
| /* | |
| * Step 1. get access token using curl | |
| * https://developers.google.com/gdata/articles/using_cURL | |
| * | |
| * service name list | |
| * https://developers.google.com/gdata/faq#clientlogin | |
| * | |
| */ | |
| curl https://www.google.com/accounts/ClientLogin \ |
| /** | |
| * Tutorial | |
| * | |
| * Step1. install nodejs & npm (download: http://nodejs.org/download/) | |
| * | |
| * Step2. install express (http://expressjs.com/) | |
| * $ sudo npm install express -g | |
| * | |
| * Step3. $ node app |
copy and paste on Terminal.app
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublimefull document(https://gist.github.com/artero/1236170)
| var keycode = { | |
| 'backspace' : '8', | |
| 'tab' : '9', | |
| 'enter' : '13', | |
| 'shift' : '16', | |
| 'ctrl' : '17', | |
| 'alt' : '18', | |
| 'pause_break' : '19', | |
| 'caps_lock' : '20', | |
| 'escape' : '27', |