(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| [alias] | |
| recent = "!git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' | head -n 10" | |
| co = checkout | |
| cob = checkout -b | |
| coo = !git fetch && git checkout | |
| br = branch | |
| brd = branch -d | |
| brD = branch -D | |
| merged = branch --merged | |
| st = status |
| # This is just a cheat sheet: | |
| # On production | |
| sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
| # On local | |
| scp -C production:~/database.sql.gz | |
| dropdb database && createdb database | |
| gunzip < database.sql.gz | psql database |
| import exifread | |
| # based on https://gist.github.com/erans/983821 | |
| def _get_if_exist(data, key): | |
| if key in data: | |
| return data[key] | |
| return None |
| echo -e "\nHidden=true\n"|sudo tee --append /etc/xdg/autostart/tracker-extract.desktop | |
| echo -e "\nHidden=true\n"|sudo tee --append /etc/xdg/autostart/tracker-miner-apps.desktop | |
| echo -e "\nHidden=true\n"|sudo tee --append /etc/xdg/autostart/tracker-miner-fs.desktop | |
| echo -e "\nHidden=true\n"|sudo tee --append /etc/xdg/autostart/tracker-miner-user-guides.desktop | |
| echo -e "\nHidden=true\n"|sudo tee --append /etc/xdg/autostart/tracker-store.desktop | |
| gsettings set org.freedesktop.Tracker.Miner.Files crawling-interval -2 | |
| gsettings set org.freedesktop.Tracker.Miner.Files enable-monitors false | |
| tracker reset --hard |
Using py.test is great and the support for test fixtures is pretty awesome. However, in order to share your fixtures across your entire module, py.test suggests you define all your fixtures within one single conftest.py file. This is impractical if you have a large quantity of fixtures -- for better organization and readibility, you would much rather define your fixtures across multiple, well-named files. But how do you do that? ...No one on the internet seemed to know.
Turns out, however, you can define fixtures in individual files like this:
tests/fixtures/add.py
import pytest
@pytest.fixture# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
e.g: tar -czvf name-of-archive.tar.gz /path/to/directory-or-file