(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:
| ################################################################## | |
| # /etc/elasticsearch/elasticsearch.yml | |
| # | |
| # Base configuration for a write heavy cluster | |
| # | |
| # Cluster / Node Basics | |
| cluster.name: logng | |
| # Node can have abritrary attributes we can use for routing |
| 0 = Success | |
| 1 = Operation not permitted | |
| 2 = No such file or directory | |
| 3 = No such process | |
| 4 = Interrupted system call | |
| 5 = Input/output error | |
| 6 = No such device or address | |
| 7 = Argument list too long | |
| 8 = Exec format error |
| " Executes the current ruby line when there is a # => | |
| " marker at the end replacing it with the evaled | |
| " result | |
| function! RubyExecuteLineWithMarker() | |
| ruby << EOF | |
| marker = '# =>' | |
| buffer = VIM::Buffer.current | |
| if buffer.line.match(/#{marker}/) | |
| result = marker + ' ' + eval(buffer.line, binding).inspect | |
| buffer.line = buffer.line.sub(/#{marker}.*/, result).chomp |
| #cribbed from http://vimeo.com/52569901 (Twilio carrier call origination moderation) | |
| # The idea is that many fan-in queues can enqueue at any rate, but | |
| # dequeue needs to happen in a rate-controlled manner without allowing | |
| # any individual input queue to starve other queues. | |
| # http://en.wikipedia.org/wiki/Leaky_bucket (second sense, "This version is referred to here as the leaky bucket as a queue.") | |
| # | |
| # requires: | |
| # redis 2.6+ | |
| # redis-py>=2.7.0 | |
| # anyjson |
| from twisted.internet import defer, reactor | |
| from twisted.web.client import getPage | |
| def listCallback(results): | |
| print results | |
| def finish(ign): | |
| reactor.stop() | |
| def test(): |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
| 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 |
| location /resize { | |
| alias /tmp/nginx/resize; | |
| set $width 150; | |
| set $height 100; | |
| set $dimens ""; | |
| if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) { | |
| set $width $1; | |
| set $height $2; | |
| set $image_path $3; |
| ########################################################## | |
| # How to NEVER use Lambdas. An inneficient and yet educa-# | |
| # tonal guide to the proper misuse of the lambda constru-# | |
| # ct in Python 2.x. [DO NOT USE ANY OF THIS EVER] # | |
| # by: e000 (13/6/11) # | |
| ########################################################## | |
| ## Part 1. Basic LAMBDA Introduction ## | |
| # Well, it's worth diving straight into what lambdas are. | |
| # Lambdas are pretty much anonymous "one line" functions |