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
#author [email protected] | |
require 'rubygems' | |
require 'fsevents' | |
require 'net/ssh' | |
require 'net/scp' | |
require 'ruby-growl' | |
host = "10.210.74.63" | |
username = "my name" | |
password = "my password" |
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
#!/usr/bin/ruby | |
#@auther [email protected] | |
require 'rubygems' | |
require 'net/ssh' | |
require 'net/scp' #gem install net-scp | |
host = "ip address" | |
username = "your name" | |
password = "your password" |
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 'net/http' | |
require 'cgi' | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
require "resolv-replace" | |
require 'timeout' | |
BASE_URL = "http://www.google.com/search?" | |
LANG = "ja" |
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
alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("") | |
base = alphabet.length | |
exports.encode = (i) -> | |
return alphabet[0] if i is 0 | |
s = "" | |
while i > 0 | |
s += alphabet[i % base] | |
i = parseInt(i / base, 10) |
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
// Create a path to a directory, and make sure it exists. | |
// The iOS documentation will tell you that URLs are preferred, but there is no createDirectory method for | |
// URLs. So we have to use string paths instead. | |
// Create a sub-directory in the application's Documents directory. Return the path on success, or nil on failure. | |
- (void)createDocumentSubdirectory:(NSString*)dirName { | |
NSString *retval = nil; | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *dirPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:dirName]; | |
NSFileManager *fm = [[NSFileManager alloc] init]; |
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
//from http://boredzo.org/blog/archives/2009-06-17/doing-it-wrong | |
@interface SingletonManager : NSObject {} | |
+ (id)sharedManager; | |
@end |
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
- (IBAction)btnSystemSettingTouchUpInside:(id)sender { | |
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"] ]; | |
} | |
- (IBAction)btnTwitterSettingTouchUpInside:(id)sender { | |
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"prefs:root=TWITTER"] ]; | |
} | |
- (IBAction)btnBlueToothSettingTouchUpInside:(id)sender { |
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
#import <UIKit/UIKit.h> | |
@interface UITextField (HideKeyBoard) | |
-(void)hideKeyBoard:(UIView *)view; | |
@end |
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
# 删除当前目录下所有 dep 文件 | |
find . -name *.dep -type f -exec rm -rf {} \; | |
# 删除当前目录下所有 linux64GccDPOpt 目录(包括里面的文件) | |
find . -name "linux64GccDPOpt" -type d -exec rm -rf {} \; | |
删除目录的命令提示: |
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- | |
#pragma mark UIActionSheetDelegate with logOff | |
- (void) onLogOffButtonClick:(id)sender{ | |
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"确认要退出登录吗?" delegate:self cancelButtonTitle:@"不退出" destructiveButtonTitle:@"退出" otherButtonTitles:nil, nil]; | |
[actionSheet showFromTabBar:self.navigationController.tabBarController.tabBar]; | |
XX_RELEASE_SAFELY(actionSheet); | |
} | |
- (void)logOff{ |