Skip to content

Instantly share code, notes, and snippets.

Marek Wywiał onjin

Block or report user

Report or block onjin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
onjin /
Last active Aug 29, 2019
Categories of feature toggles

Feature toggles types

Short memo from:

Release Toggles

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
onjin /
Last active Mar 6, 2019
python code profiling



Run profiler

$ python -m cProfile -o profiler.pstats ./some/python/
$ gprof2dot -f pstats profiler.pstats | dot -Tpng -o profiler.png  # generate PNG calltree image
$ pyprof2calltree -i profiler.pstats -k  # debug with kcachegrind
onjin /
Last active Dec 6, 2018
software modularity
onjin /
Last active Feb 12, 2019
tests responsibilities
onjin /
Created Nov 21, 2018
example of writing cli program
#!/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.
View .tmux.conf
# 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
xhost +
docker run \
--rm \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $(pwd)/:/data/ \
-ti eferro/freemind / $(id -u) $*
"""Start interactive console on SIGUSR1 signal.
$ python ./
and in another window
$ ps aux|grep sigusr1_debug
$ kill -10 [process pid]
and in first window you get:
Signal received : entering python shell.
View wpinstall.php
file_put_contents('', fopen('', 'r'));
system('unzip ./');
system('rm ./');
system('mv wordpress/* .');
system('rmdir wordpress');
You can’t perform that action at this time.