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
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon | |
### END INIT INFO |
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
Source: http://seraphyn.teiko.org/archives/996-Debian-Squeeze-TTY-Aufloesung-Schriftgroesse.html | |
available settings: | |
hwinfo --framebuffer | |
edit /etc/default/grub | |
set GRUB_GFXMODE | |
e.g. GRUB_GFXMODE=1024x768 | |
edit /etc/grub.d/00_header from |
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
filetype on "autodetect filetype | |
syntax on | |
filetype plugin indent on | |
set title | |
set nocompatible | |
set tabstop=2 | |
set backspace=2 | |
set ai | |
set si |
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
git config --global color.diff always | |
git log --pretty=format:'%h : "%s" by %an, %ar' --date-order --graph --stat |
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)viewDidLoad { | |
[super viewDidLoad]; | |
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; | |
[button setTitle:@"BUTTON" forState:UIControlStateNormal]; | |
[button setFrame:CGRectMake(50, 50, 150, 150)]; | |
[self.view addSubview:button]; | |
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(invokePanGesture:)]; |
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
CGPoint velocity = [gestureRecognizer velocityInView:currentView]; | |
if (velocity.x * lastGestureVelocity.x + velocity.y * lastGestureVelocity.y > 0) { | |
//NSLog(@"gesture went in same direction"); | |
} | |
else { | |
NSLog(@"gesture went in opposite direction"); | |
} | |
lastGestureVelocity = velocity; |
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
#source: http://asemanfar.com/Current-Git-Branch-in-Bash-Prompt | |
c_cyan=`tput setaf 6` | |
c_red=`tput setaf 1` | |
c_green=`tput setaf 2` | |
c_sgr0=`tput sgr0` | |
parse_git_branch () | |
{ | |
if git rev-parse --git-dir >/dev/null 2>&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
@interface NSString (Zeros) | |
-(NSString*)removeLeadingZeros; | |
-(NSString*)addLeadingZerosTillLength:(int)length; | |
@end | |
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
-(BOOL)isNumeric:(NSString*)string { | |
NSLocale *l_de = [[NSLocale alloc] initWithLocaleIdentifier: @"de_DE"]; | |
NSNumberFormatter *f = [[NSNumberFormatter alloc] init]; | |
[f setLocale: l_de]; | |
[f setAllowsFloats: YES]; | |
if ([f numberFromString:string]) { | |
return YES; | |
} | |
return NO; |
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
#import <Foundation/Foundation.h> | |
@interface NSError(LocalizedError) | |
/** | |
Utility method to create a localized NSError with the given error-domain, error-code and description text. | |
*/ | |
+ (NSError*)localizedErrorWithDomain:(NSString*)domain code:(NSInteger)code andDescription:(NSString*)description; |
OlderNewer