(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:
| /** GenerateThumbnail | |
| * generate a thumbnail of an image | |
| * | |
| * ==Overview== | |
| * {{{ | |
| * val thumbnail = new Thumbnailer(.25, "image.jpg", "image-thumbnail.jpg") | |
| * val resized = thumbnail.resize() | |
| * thumbnail.save() | |
| * }}} | |
| */ |
| public class MemoizedLambdaFib { | |
| interface MemoizedFunction<T, R> { | |
| enum Cache { | |
| _; | |
| Map<Object, Object> vals = new HashMap<>(); | |
| } | |
| R calc(T t); |
| import json | |
| from urllib2 import urlopen | |
| import socket | |
| from time import sleep | |
| UDP_ADDRESS = "carbon.hostedgraphite.com" | |
| UDP_PORT = 2003 | |
| RIAK_STATS_URL='http://localhost:11098/stats' | |
| HG_API_KEY='Your Api Key from HostedGraphite.com' |
| define homebrew::tap ( | |
| $ensure = present, | |
| ) { | |
| if $ensure == 'present' { | |
| exec { "homebrew_tap_${name}": | |
| command => "brew tap ${name}", | |
| unless => "brew tap | grep ${name}", | |
| } | |
| } else { | |
| exec { "homebrew_untap_${name}": |
| #!/bin/bash | |
| find app/code/core/Mage app/code/core/Enterprise app/code/core/Zend lib/Varien lib/Mage lib/Zend -type f | grep -v '\.svn' | sort -d -f -k1 | xargs md5sum | awk {'print $2, $1'} > 1.11.2.0.local.md5 | |
| diff 1.11.2.0.base.md5 1.11.2.0.local.md5 |
| curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' |
| class FakeParser | |
| def self.call(body, format) | |
| body | |
| end | |
| end |
| # bash alias | |
| alias subl='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl' | |
| # bash function, usage: $ st -p [projectname] -opt2 -opt3 | |
| function st() { | |
| if [ -n "$1" -a -n "$2" ]; then # if more than one argument | |
| if [ "$1" = "-p" -o "$1" = "--project" ]; then # if arg1 is -p or --project | |
| local projectfile="$2" | |
| [[ $projectfile != *.sublime-project ]] && projectfile="$2.sublime-project" # detect if arg2 already includes the ext | |
| if [ -e $projectfile ]; then # does project file exist? |
| import java.util.Properties | |
| import kafka.server.KafkaServer | |
| import kafka.server.KafkaConfig | |
| import kafka.producer.ProducerConfig | |
| import kafka.producer.Producer | |
| import kafka.message.Message | |
| import kafka.producer.ProducerData | |
| import kafka.consumer.ConsumerConfig | |
| import kafka.consumer.Consumer | |
| import kafka.utils.Utils |