(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
:
var NodeChatController = { | |
init: function() { | |
this.socket = io.connect('http://localhost'); | |
var mysocket = this.socket; | |
this.model = new models.NodeChatModel(); | |
this.view = new NodeChatView({model: this.model, socket: this.socket, el: $('#content')}); | |
var view = this.view; | |
this.socket.on('message', function(msg) { |
development: | |
client_id: [your client id] | |
client_secret: [your client secret] | |
test: | |
client_id: [your client id] | |
client_secret: [your client secret] | |
production: |
require 'yaml'# Load auth config | |
AUTH_CONFIG = YAML.load_file("#{::Rails.root}/config/auth.yml")[::Rails.env] | |
Rails.application.config.middleware.use OmniAuth::Builder do | |
provider :google_oauth2, AUTH_CONFIG["client_id"], AUTH_CONFIG["client_secret"], { | |
scope: 'https://www.googleapis.com/auth/userinfo.email https://www.google.com/reader/api/' | |
} | |
end |
require 'oauth2' | |
class SessionsController < ApplicationController | |
def create | |
# Get data back from OmniAuth | |
@auth = request.env["omniauth.auth"] | |
@token = @auth["credentials"]["token"] | |
# Create an OAuth2 client and access token, | |
# which we will use to access the API. | |
@client = OAuth2::Client.new(AUTH_CONFIG["client_id"], AUTH_CONFIG["client_secret"], :site => "https://www.google.com/reader/") |
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.8/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"> | |
<page> | |
<title>Anarchism</title> | |
<ns>0</ns> | |
<id>12</id> | |
<revision> | |
<id>563200406</id> | |
<parentid>563200009</parentid> | |
<timestamp>2013-07-07T05:02:36Z</timestamp> | |
<contributor> |
# -*- coding: utf-8 -*- | |
text = """ | |
The Eagle has landed. The regret on our side is, they used to say years ago, we are reading about you in science class. Now they say, we are reading about you in history class. | |
Never in all their history have men been able truly to conceive of the world as one: a single sphere, a globe, having the qualities of a globe, a round earth in which all the directions eventually meet, in which there is no center because every point, or none, is center, an equal earth which all men occupy as equals. The airman's earth, if free men make it, will be truly round: a globe in practice, not in theory. | |
For those who have seen the Earth from space, and for the hundreds and perhaps thousands more who will, the experience most certainly changes your perspective. The things that we share in our world are far more valuable than those which divide us. | |
""" |
@interface LoginViewController : UIViewController <UITextFieldDelegate, UIWebViewDelegate> | |
@end |
from unittest.mock import patch | |
class Patcher(): | |
""" | |
This class provides a central place for managing | |
commonly used patches for tests. | |
Example:: | |
p = Patcher([ |
# Required for vim's copy and paste to work in tmux. | |
# Install this first: | |
# brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace | |
set-option -g default-command "reattach-to-user-namespace -l bash" | |
# Set Ctrl-a as prefix | |
# (instead of Ctrl-b) | |
unbind C-b | |
set -g prefix C-a | |
bind C-a send-prefix |