(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
As configured in my dotfiles.
start new:
tmux
start new with session name:
| var data = sc.parallelize(Seq(("A", 2), ("A", 4), ("B", 2), ("Z", 0), ("B", 10))) | |
| // data: org.apache.spark.rdd.RDD[(java.lang.String, Int)] = ParallelCollectionRDD[31] at parallelize at <console>:12 | |
| val avgValue = data.mapValues((_, 1) | |
| .reduceByKey((x, y) => (x._1 + y._1, x._2 + y._2)) | |
| .mapValues{ case (sum, count) => (1.0 * sum) / count } | |
| .collectAsMap() | |
| // avgValue: scala.collection.Map[java.lang.String,Double] = Map(Z -> 0.0, B -> 6.0, A -> 3.0) |
| #!/bin/bash | |
| # A script to set up a new mac. Uses bash, homebrew, etc. | |
| # Focused for ruby/rails development. Includes many utilities and apps: | |
| # - homebrew, rvm, node | |
| # - quicklook plugins, terminal fonts | |
| # - browsers: chrome, firefox | |
| # - dev: iterm2, sublime text, postgres, chrome devtools, etc. | |
| # - team: slack, dropbox, google drive, skype, etc |
After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.
This is the process I used to create a CSV file of his credentials in the format “example.com,user,pass”. This portable format would be pretty easy to import into 1Password or Safari in the future.
The way I went about this isn’t great; it opens up more opportunities for apps to control one’s Mac through Accessibility APIs, it writes plaintext passwords to disk, and it could use some cleaning up. A better approach might leverage the security command line tool that ships with OS X. That said, I found this method to be a fun illustration of what’s possible us