This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # select weechat window | |
| bind -n F9 run-shell "tmux select-window -t ${WEECHAT_TMUX_WINNUM}" | |
| # back to the previous window | |
| bind -n S-F9 select-window -l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function peco-ssh() { | |
| local _host=$(grep -o '^\S\+' ~/.ssh/known_hosts | tr -d '[]' | tr ',' '\n' | sort | peco) | |
| if [ ${TMUX} ]; then | |
| eval $(printf "tmux neww -n %s 'ssh %s'" ${_host} ${_host}) | |
| else | |
| eval $(printf 'ssh %s' ${_host}) | |
| fi | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Vim: | |
| def editor(): | |
| print "Vi Improved" | |
| class CtrlP: | |
| def method(): | |
| print "ctrlp!" | |
| class Funky(Vim, CtrlP): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main () { | |
| puts("main"); | |
| return 0; | |
| } | |
| int func1() { | |
| int a = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let g:ctrlp_prompt_mappings = { | |
| \ 'AcceptSelection("e")': ['<C-e>'], | |
| \ 'AcceptSelection("t")': ['<Cr>'], | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Capybara.register_driver :chrome do |app| | |
| opts = { | |
| browser: :chrome, | |
| switches: %w( --test-type --window-size=1280,1024 ) | |
| } | |
| Capybara::Selenium::Driver.new(app, opts) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if _, ok := m[sessionid]; !ok { | |
| m[sessionid] = 0 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import os,sys,time | |
| os.environ['TERM'] = 'xterm' | |
| pid,fd = os.forkpty() | |
| if pid == 0: | |
| os.execv('/sbin/esxtop', []) | |
| sys.exit(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -Cueo pipefail | |
| DISTRO= | |
| ## on CentOS 7 | |
| sudo yum install lua-libs lua-devel ncurses-devel python36 python36-devel | |
| ./configure --prefix=$HOME/opt/vim --enable-fail-if-missing --includedir=/usr/include --enable-python3interp=yes --enable-rubyinterp=no --enable-luainterp=yes --enable-multibyte --enable-gui=no --enable-terminal --disable-netbeans --disable-farsi --disable-arabic --disable-rightleft --with-python3-command=python3.6 --with-features=huge --build make && make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ch := make(chan byte, 1) | |
| for p := range projs { | |
| go func() { | |
| r := getData(p) | |
| fmt.Println(r) | |
| ch <- 1 | |
| } | |
| <-ch | |
| }() |