A Pen by Demetri Ganoff on CodePen.
| p = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) | |
| # Grab stdout line by line as it becomes available. This will loop until | |
| # p terminates. | |
| while p.poll() is None: | |
| l = p.stdout.readline() # This blocks until it receives a newline. | |
| print l | |
| # When the subprocess terminates there might be unconsumed output | |
| # that still needs to be processed. | |
| print p.stdout.read() |
| ;; TRAMP gcloud ssh | |
| (add-to-list 'tramp-methods | |
| '("gssh" | |
| (tramp-login-program "gssh") | |
| (tramp-login-args (("%h"))) | |
| (tramp-async-args (("-q"))) | |
| (tramp-remote-shell "/bin/sh") | |
| (tramp-remote-shell-args ("-c")) | |
| (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") | |
| ("-o" "UserKnownHostsFile=/dev/null") |
"Roswell Script" is implementation-independent Common Lisp scripting program which uses Roswell. Although Roswell itself is a unified interface to Common Lisp implementations, it also encourages writing scripts with it.
To start writing it, run ros init in your terminal:
$ ros init
Usage: ros init [template] name [options...]
| import | |
| asyncdispatch, asyncnet, htmlparser, xmltree, httpclient, strutils, | |
| strtabs, streams, uri, sets | |
| var visited = initSet[string]() | |
| proc crawl(url: string, client: PAsyncHttpClient = newAsyncHttpClient()) {.async.} = | |
| if url in visited: return # Already visited this URL. | |
| echo("Crawling ", url) | |
| visited.incl(url) |
| .vimrc | |
| " Map leader to comma | |
| let maplocalleader="," | |
| " Toggle this for vim-sexp to not go into insert mode after wrapping something | |
| let g:sexp_insert_after_wrap = 0 | |
| " Toggle this to disable automatically creating closing brackets and quotes | |
| let g:sexp_enable_insert_mode_mappings = 1 | |
| Vocab |
These are for the combined vim-sexp (https://github.com/guns/vim-sexp) and vim-sexp-mappings-for-regular-people (https://github.com/tpope/vim-sexp-mappings-for-regular-people) plugins. vim-sexp is neat on its own but Tim Pope makes common stuff much easier.
Note that some vim-sexp functionality depends on <LocalLeader> mappings. This is a different leader key than the global leader, and is the variable maplocalleader (instead of mapleader). To see if you have this set, use :echo maplocalleader; if it errors out you'll need to set it, otherwise it will echo the key. If you want to set your LocalLeader to <Space>, you'll need two commands in your .vimrc, since by default <Space> is bound to <Right> in normal mode:
nnoremap <Space> <Nop>
let maplocalleader=" "