Short memo from:
For not finished / not tested features
- Configuration type: static - per environment, f.i. enabled only on test/stage
- Lifetime: Short - until feature is finished / tested
| if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then | |
| tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux | |
| fi |
| #!/usr/bin/env bash | |
| set -eu | |
| pane_fmt="#{pane_id} #{pane_in_mode} #{pane_input_off} #{pane_dead} #{pane_current_command}" | |
| tmux list-panes -s -F "$pane_fmt" | awk ' | |
| $2 == 0 && $3 == 0 && $4 == 0 && $5 ~ /(bash|zsh|ksh|fish)/ { print $1 } | |
| ' | while read -r pane_id; do | |
| # renew environment variables according to update-environment tmux option | |
| # also clear screen |
Short memo from:
For not finished / not tested features
https://www.youtube.com/watch?v=zXCiv4sc5eY
Failure = Repeating the bad decisions
Success = Consistency on good decisions
Rule of success = Delay gratification!
Install https://github.com/jrfonseca/gprof2dot
$ python -m cProfile -o profiler.pstats ./some/python/code.py
$ gprof2dot -f pstats profiler.pstats | dot -Tpng -o profiler.png # generate PNG calltree image
$ pyprof2calltree -i profiler.pstats -k # debug with kcachegrindNotes to modularity talk:
https://speakerdeck.com/skmetz/magic-tricks-of-testing-railsconf?slide=187
| #!/usr/bin/env python | |
| import argparse | |
| import getpass | |
| import sys | |
| from contextlib import contextmanager | |
| from distutils.util import strtobool | |
| def yes_or_no(question, default='no'): | |
| """Ask question and wait for yes/no answer. |
| # Rebind prefix key | |
| unbind C-b | |
| set-option -g prefix C-a | |
| bind-key C-a send-prefix | |
| # Pretty colors | |
| # set -g status-bg blue | |
| # set -g status-fg white | |
| # Bindings |
| #!/bin/bash | |
| xhost + | |
| docker run \ | |
| --rm \ | |
| -e DISPLAY=$DISPLAY \ | |
| -v /tmp/.X11-unix:/tmp/.X11-unix \ | |
| -v $(pwd)/:/data/ \ | |
| -ti eferro/freemind /freemind.sh $(id -u) $* |