Install HomeBrew first
brew update
brew tap caskroom/cask
brew install brew-caskIf you get the error "already installed", follow the instructions to unlink it, then install again:
Install HomeBrew first
brew update
brew tap caskroom/cask
brew install brew-caskIf you get the error "already installed", follow the instructions to unlink it, then install again:
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| /* | |
| Question: | |
| What will be printed by this program? |
Install cask that extends the brew command :
brew install phinze/cask/brew-cask
Install calibre using cask :
brew cask install calibre
WARNING: If you're reading this in 2021 or later, you're likely better served by reading:
(This gist was created in 2013 and targeted the legacy GOPATH mode.)
$ ssh -A vm
$ git config --global url."[email protected]:".insteadOf "https://github.com/"| /* | |
| * I add this to html files generated with pandoc. | |
| */ | |
| html { | |
| font-size: 100%; | |
| overflow-y: scroll; | |
| -webkit-text-size-adjust: 100%; | |
| -ms-text-size-adjust: 100%; | |
| } |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| /* | |
| A Tour of Go: page 44 | |
| http://tour.golang.org/#44 | |
| Exercise: Loops and Functions | |
| As a simple way to play with functions and loops, implement the square root function using Newton's method. | |
| In this case, Newton's method is to approximate Sqrt(x) by picking a starting point z and then repeating: z - (z*z - x) / (2 * z) |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |