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
alias dstop='docker kill $(docker ps -q)' | |
alias rmdc='docker rm $(docker ps -a -q)' | |
alias rmdi='docker rmi $(docker images --filter "dangling=true" -q --no-trunc)' | |
alias df='df -h ' | |
alias cp='cp -rv' |
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 Timer(onTick) { | |
var self = this, | |
interval, | |
startTime, | |
count | |
self.start = function() { | |
count = 0 | |
startTime = (new Date()).toISOString() | |
interval = window.setInterval(function() { |
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
## updated for Ubuntu 16.04 | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java7-installer | |
sudo apt-get remove scala-library scala | |
sudo wget www.scala-lang.org/files/archive/scala-2.11.8.deb | |
sudo dpkg -i scala-2.11.8.deb | |
sudo apt-get update | |
sudo apt-get install scala | |
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list |
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
extension EasyTipView{ | |
func show(animated animated: Bool = true, forView view: UIView, withinSuperview superview: UIView? = nil, autoDismissAfter: Double) { | |
self.show(animated: animated, forView: view, withinSuperview: superview) | |
let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(autoDismissAfter * Double(NSEC_PER_SEC))) | |
dispatch_after(delayTime, dispatch_get_main_queue()) { [weak self] in | |
self?.dismiss() | |
} | |
} | |
} |
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) performSelectorAsync:(SEL) selector completion:(void(^)(id result))completion { | |
if ([self respondsToSelector:selector]) { | |
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){ | |
//Background Thread | |
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:selector]]; | |
[invocation setSelector:selector]; | |
[invocation setTarget:self]; | |