If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"
npm adduser
docker-machine create --driver amazonec2 \ | |
--amazonec2-instance-type t2.nano \ | |
--amazonec2-region eu-west-1 \ | |
node-name |
# Give ownership of directory to user/group | |
sudo chown -R <user>:<group> directory | |
sudo chown -R :<group> directory | |
sudo chown -R <user>: directory | |
# Add user to group | |
sudo usermod -a -G groupName userName |
// LTS = v4.x, change accordingly | |
curl -sL https://deb.nodesource.com/setup_4.x | sudo bash - |
docker rmi $(docker images -q -f dangling=true) |
import UIKit | |
extension UIView { | |
func findSuperviewWithClass<T>(superViewClass : T.Type) -> UIView? { | |
var xsuperView : UIView! = self.superview! | |
var foundSuperView : UIView! | |
while (xsuperView != nil && foundSuperView == nil) { | |
if xsuperView.self is T { | |
foundSuperView = xsuperView |
# Resolve DNS | |
nslookup | |
# List of open internet connections established | |
# lsof is much more general purpose | |
lsof -i | grep -E "(LISTEN|ESTABLISHED)" | |
# Monitor network traffic & connections | |
nettop |
// Delay function expressed in ms | |
func delay(delay:Double, closure:()->()) { | |
dispatch_after( | |
dispatch_time( | |
DISPATCH_TIME_NOW, | |
Int64(delay * 1000000.0) | |
), | |
dispatch_get_main_queue(), closure) | |
} |
for family: String in UIFont.familyNames() { | |
print("\(family)") | |
for names: String in UIFont.fontNamesForFamilyName(family) { | |
print("== \(names)") | |
} | |
} |
#Remove staged file | |
git reset HEAD -- path/to/file | |
#Remove all staged files | |
git reset HEAD -- . | |
#Delete local branch | |
git branch -d branch_name | |
#Delete remote branch |