(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:
| #!/usr/bin/env python | |
| # http://www.rabbitmq.com/tutorials/tutorial-two-python.html | |
| import pika | |
| import sys | |
| connection = pika.BlockingConnection(pika.ConnectionParameters( | |
| host='localhost')) | |
| channel = connection.channel() | |
| message = ' '.join(sys.argv[1:]) or "Hello World!" |
| #!/usr/bin/env bash | |
| repo=$1 | |
| rm -fr /tmp/gpm \ | |
| && mkdir /tmp/gpm \ | |
| && cd /tmp/gpm \ | |
| && curl -#L https://github.com/$repo/tarball/master \ | |
| | tar zx --strip 1 \ | |
| && make install |
| import Foundation | |
| import objc | |
| import AppKit | |
| import sys | |
| NSUserNotification = objc.lookUpClass('NSUserNotification') | |
| NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter') | |
| def notify(title, subtitle, info_text, delay=0, sound=False, userInfo={}): | |
| notification = NSUserNotification.alloc().init() |
| # http://www.rabbitmq.com/tutorials/tutorial-two-python.html | |
| import sys, time, json, logging | |
| import pika | |
| hostname = 'localhost' | |
| logging.getLogger('pika').setLevel(logging.ERROR) | |
| class RabbitMQ(object): | |
| def __init__(self, hostname, queue, exchange = ''): | |
| self.hostname = hostname |
| class throttle(object): | |
| """ | |
| Decorator that prevents a function from being called more than once every | |
| time period. | |
| To create a function that cannot be called more than once a minute: | |
| @throttle(minutes=1) | |
| def my_fun(): | |
| pass |
| ; To run these examples (assuming you have homebrew installed): | |
| ; | |
| ; $ brew install leiningen | |
| ; ... | |
| ; $ lein repl | |
| ; | |
| ; ... this drops you into the Clojure REPL (Read, Evaluate, Print, Loop). | |
| ; | |
| ; Copy and paste the lines below and play around. |
| require 'formula' | |
| class Thrift < Formula | |
| homepage 'http://thrift.apache.org' | |
| # The thrift.apache.org 0.9.1 archive is missing PHP ext, fixed in THRIFT-2129 | |
| # By grapping the source from git instead, it's fixed, but we need to bootstrap | |
| url 'https://git-wip-us.apache.org/repos/asf/thrift.git', :branch => "0.9.1" | |
| version "0.9.1" | |
| head do |