a
: after cursori
: before cursorA
: after lineI
: before lineo
: add a new line belowO
: add a new line above
# ~/.ipython/profile_default/startup/00_common.py | |
import base64 | |
import codecs | |
import cPickle as pickle | |
import cStringIO as StringIO | |
import csv | |
import hashlib | |
import importlib | |
import json | |
import math |
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>*</AllowedOrigin> | |
<AllowedMethod>GET</AllowedMethod> | |
<MaxAgeSeconds>3000</MaxAgeSeconds> | |
<AllowedHeader>Content-*</AllowedHeader> | |
<AllowedHeader>Host</AllowedHeader> | |
</CORSRule> | |
</CORSConfiguration> |
# Clear local merged branches | |
function clearbranches(){ | |
cur_branch=`git rev-parse --abbrev-ref HEAD` | |
if [[ "$cur_branch" == "master" ]]; then | |
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d | |
else | |
echo "Not on master branch!" | |
fi | |
} |
from __future__ import print_function | |
from tornado.gen import Task, Return, coroutine | |
import tornado.process | |
from tornado.ioloop import IOLoop | |
import subprocess | |
import time | |
STREAM = tornado.process.Subprocess.STREAM |
If you need a good way to secure your Django admin site (e.g., http://example.com/admin/), this is it.
Reference: https://gist.github.com/mtigas/952344
This is a guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with Python programming.
For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way
For a guide similar to this one for JavaScript developers, refer to Vim Script for the JavaScripter
This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, [key-mapping](https://vimhelp.org/map.txt.html#key-m