This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| import os | |
| def head(filename, count=1): | |
| """ | |
| This one is fairly trivial to implement but it is here for completeness. | |
| """ | |
| with open(filename, 'r') as f: | |
| lines = [f.readline() for line in xrange(1, count+1)] | |
| return filter(len, lines) |
| ''' | |
| Basic tail command implementation | |
| Usage: | |
| tail.py filename numlines | |
| ''' | |
| import sys | |
| import linecache |
I’ll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/ with $HOME\vimfiles\ and forward slashes with backward slashes.
Vim plugins can be single scripts or collections of specialized scripts that you are supposed to put in “standard” locations under your ~/.vim/ directory. Syntax scripts go into ~/.vim/syntax/, plugin scripts go into ~/.vim/plugin, documentation goes into ~/.vim/doc/ and so on. That design can lead to a messy config where it quickly becomes hard to manage your plugins.
This is not the place to explain the technicalities behind Pathogen but the basic concept is quite straightforward: each plugin lives in its own directory under ~/.vim/bundle/, where each directory simulates the standard structure of your ~/.vim/ directory.
| # Initialize the scroll | |
| page = es.search( | |
| index = 'yourIndex', | |
| doc_type = 'yourType', | |
| scroll = '2m', | |
| search_type = 'scan', | |
| size = 1000, | |
| body = { | |
| # Your query's body | |
| }) |
| """Kelly O'Shaughnessy | |
| Rotate nxn matrix by 90 degrees""" | |
| def rotate(matrix): | |
| if matrix is None or len(matrix)<1: | |
| return | |
| else: | |
| if len(matrix)==1: | |
| return matrix | |
| else: | |
| #solution matrix |