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)appendStringOrEmpty:(NSString*)string{ | |
if (string) { | |
[self appendString:string]; | |
} else { | |
[self appendString:@""]; | |
} | |
} |
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
+ (UIImage *)imageFromView:(UIView *)view | |
{ | |
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { | |
if ([[UIScreen mainScreen] scale] == 2.0) { | |
UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 2.0); | |
} else { | |
UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 1.0); | |
} | |
} else { | |
UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 1.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
// the following snippet sets the number of lines to 1 | |
myTextView.attributedText = [[NSAttributedStringalloc] initWithString:@"my too long text"]; | |
myTextView.textContainer.maximumNumberOfLines = 1; | |
myTextView.textContainer.lineBreakMode = NSLineBreakByTruncatingTail; |
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
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad |
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
let layer = view.layer | |
layer.cornerRadius = CGRectGetWidth(mapView.bounds) / 2 | |
layer.borderWidth = 1 | |
layer.masksToBounds = true |
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
kopieren als reiner Text: | |
defaults write com.apple.Terminal CopyAttributesProfile com.apple.Terminal.no-attributes | |
und wieder aktivieren: | |
defaults write com.apple.Terminal CopyAttributesProfile com.apple.Terminal.attributes |
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
[Xdebug] | |
zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so | |
xdebug.remote_enable=1 | |
xdebug.remote_autostart=On | |
xdebug.remote_port=9000 | |
xdebug.profiler_enable_trigger=1 | |
xdebug.max_nesting_level=250 |
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
function strippedString(OriginalString){ | |
var newString = OriginalString.replace(/\?/g,'?'); | |
newString = newString.replace(/(<([^>]+)>)/ig,""); | |
return newString; | |
} |
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
public override func viewWillAppear(animated: Bool) { | |
super.viewWillAppear(animated) | |
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyBoardWillShow:", name: UIKeyboardDidShowNotification, object: nil) | |
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyBoardWillHide:", name: UIKeyboardDidHideNotification, object: nil) | |
} | |
public override func viewDidDisappear(animated: Bool) { | |
super.viewDidDisappear(animated) | |
NSNotificationCenter.defaultCenter().removeObserver(self) | |
} |
OlderNewer