Skip to content

Instantly share code, notes, and snippets.

View flutter_bash_completion.rst

Enable bash completion:

source <(flutter bash-completion)

Or simply add it to your ~/.bashrc

@barseghyanartur
barseghyanartur / openoffice_convert_docx_pdf_odt_to_png.md
Created Mar 18, 2021
OpenOffice convert DocX, PDF or ODT to PNG
View openoffice_convert_docx_pdf_odt_to_png.md

DocX

soffice --headless --convert-to png test.docx

PDF

soffice --headless --convert-to png test.pdf
@barseghyanartur
barseghyanartur / imagemagick_convert_docx_pdf_odt_to_png.md
Last active Mar 18, 2021
ImageMagick convert DocX, PDF or ODT to PNG
View imagemagick_convert_docx_pdf_odt_to_png.md

DocX

convert -verbose -quality 100 -fill "rgba(255,255,255,1.00)" -density 300 -alpha off test.docx test_docx.png

PDF

convert -verbose -quality 100 -fill "rgba(255,255,255,1.00)" -density 300 -alpha off test.pdf test_pdf.png
@barseghyanartur
barseghyanartur / remove_all_local_git_branches_except_master.md
Last active Mar 18, 2021
Remove all your local git branches but keep master
View remove_all_local_git_branches_except_master.md
git branch | grep -ve " master$" | xargs git branch -D
@barseghyanartur
barseghyanartur / git-pushing-multiple.rst
Created Feb 17, 2021 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.
View git-pushing-multiple.rst

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@barseghyanartur
barseghyanartur / example.md
Last active Feb 3, 2021
Docker/Podman agnostic shell scripts
View example.md

Script example

#!/bin/bash
if ! command -v podman &> /dev/null
then
    echo "podman could not be found. Falling back to docker"
    shopt -s expand_aliases
    alias podman='docker'
    alias podman-compose='docker-compose'
@barseghyanartur
barseghyanartur / venv_on_python39.md
Created Feb 2, 2021
Install virtualenv on Python 3.9
View venv_on_python39.md

Install virtualenv on Python 3.9

Add dead-snakes repository:

sudo add-apt-repository ppa:deadsnakes/ppa

Install Python 3.9, development package and the specific venv:

@barseghyanartur
barseghyanartur / alias.md
Created Feb 2, 2021
Useful additional commands for Docker
View alias.md

Useful additional commands for Docker

Stop all running containers**

Make an alias

alias docker-stop-all='docker stop $(docker ps -a -q)'

Usage example