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
alias cd..='cd ..' | |
alias gs='git status' |
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
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) | |
} |
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
function strippedString(OriginalString){ | |
var newString = OriginalString.replace(/\?/g,'?'); | |
newString = newString.replace(/(<([^>]+)>)/ig,""); | |
return newString; | |
} |
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
extension UIImage { | |
/** | |
returns an UIImage with the given height | |
**/ | |
func resizedImage(newHeight: CGFloat) -> UIImage { | |
let scale = newHeight / self.size.height | |
let newWidth = self.size.width * scale | |
UIGraphicsBeginImageContext(CGSize(width: newWidth, height: newHeight)) | |
self.draw(in: CGRect(x: 0, y: 0, width: newWidth, height: newHeight)) | |
let newImage = UIGraphicsGetImageFromCurrentImageContext() |
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
[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 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
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 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
class SingletonClass { | |
static let shared = SingletonClass() | |
// mark init as private to prevent from calling it directly | |
private init(){ | |
// set your default properties | |
} | |
class var shared: SingletonClass { |
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
let layer = view.layer | |
layer.cornerRadius = CGRectGetWidth(mapView.bounds) / 2 | |
layer.borderWidth = 1 | |
layer.masksToBounds = true |
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
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad |
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
// 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; |