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
;; Basic Settting | |
(push "/usr/local/bin" exec-path) | |
(setq make-backup-files nil) | |
(setq auto-save-default nil) | |
(setq-default tab-width 2) | |
(setq-default indent-tabs-mode nil) | |
(setq inhibit-startup-message t) | |
(fset 'yes-or-no-p 'y-or-n-p) | |
(delete-selection-mode t) | |
(scroll-bar-mode -1) |
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)keyboardWillShow:(NSNotification *)notification | |
{ | |
NSArray *appWindows = [[UIApplication sharedApplication] windows]; | |
UIWindow *keyboardWindow = [appWindows lastObject]; | |
UIView *keyboardView = [keyboardWindow.subviews objectAtIndex:0]; | |
keyboardView = [keyboardView.subviews objectAtIndex:0]; | |
keyboardView = [keyboardView.subviews objectAtIndex:0]; | |
keyboardView = [keyboardView.subviews objectAtIndex:0]; | |
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
-------------for iOS 5--------------- | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardDidChangeFrameNotification object:nil]; | |
} | |
//dont forget to [[NSNotificationCenter defaultCenter] removeObserver:self]; on viewDidUnload | |
- (void)viewDidUnload | |
{ |
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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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
#0> non-block call | |
Thread.new do | |
blahbla... | |
end | |
#1> 4 simple ways to call shell or cmd | |
`ps aux` |