(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
:
class D(dict): | |
def __init__(self): | |
dict.__init__(self) | |
def __getitem__(self, key): | |
val = D() | |
try: | |
val = dict.__getitem__(self, key) | |
except: | |
dict.__setitem__(self, key, val) |
#!/bin/bash | |
read -s -p "GitHub password: " pass | |
# I assume the GitHub API and authentication works because I don't want to parse JSON | |
curl -u "yefim323:$pass" https://api.github.com/user/repos -d "{\"name\":\"$1\"}" > /dev/null | |
git remote add origin [email protected]:yefim323/$1.git |
# A | |
# B | |
# | |
# D | |
# | |
# C | |
# E | |
# | |
# F | |
# |
This playbook has been removed as it is now very outdated. |
import sys, os, socket | |
s = socket.socket() | |
s.bind((sys.argv[1], int(sys.argv[2]))) | |
s.listen(5) | |
try: | |
while True: | |
conn, addr = s.accept() | |
path = os.path.join(os.getcwd(), "./"+conn.recv(4096).split("\n")[0].split(" ")[1]) | |
conn.send((open(path).read() if os.path.isfile(path) else reduce(lambda x,s:x+"\n"+s+("/" if os.path.isdir(s) else ""),sorted(os.listdir(path)),"Directory "+path+" ls")) if os.path.exists(path) else '404: '+path) | |
conn.close() |
import BaseHTTPServer as b,sys,os,json,urlparse | |
p=(json.loads(open(sys.argv[1]).read()) if os.path.exists(sys.argv[1]) else {}) | |
n="<br/>" | |
h="""<form action=%s method="post">Post: <textarea name="a"></textarea><input type="submit" value="Post!"/></form>""" | |
y=lambda s:urlparse.parse_qs(s)['a'][0] | |
class F(b.BaseHTTPRequestHandler): | |
def do_GET(s): | |
s.send_response(200) | |
s.send_header("Content-type","text/html") | |
s.end_headers() |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
import sys | |
while True: | |
l = raw_input() | |
sys.stdout.write(l+"\n") | |
sys.stdout.flush() |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
typedef unsigned int u32; | |
typedef unsigned long long u64; | |
//------------------------------------------------------------------------- | |
// WorkArea | |
//------------------------------------------------------------------------- |