Skip to content

Instantly share code, notes, and snippets.

### Webscope s.r.o. Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (“Projects”) made available by Webscope s.r.o. or its affiliates (“Webscope.io"). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to Webscope.io in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact [email protected].
You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
**Copyright License.** You hereby grant, and agree to grant, to Webscope.io a no

Keybase proof

I hereby claim:

  • I am jvorcak on github.
  • I am vorcak (https://keybase.io/vorcak) on keybase.
  • I have a public key ASCslnMCsCdB1zXAnqI-lb0Ddf2gkTVlau6N3Ry2Wr6HsQo

To claim this, I am signing this object:

https://andrewjamesjohnson.com/restoring-tmux-sessions/
@jvorcak
jvorcak / join-for-objects.py
Created January 30, 2020 17:02
Python join for objects
from itertools import chain
list(chain.from_iterable((a, 1) for a in ['a', 'b', 'c']))[:-1]
Out: ['a', 1, 'b', 1, 'c']
@jvorcak
jvorcak / gist:395e8705bf0031fe9a43669bc1d15aeb
Created October 16, 2019 06:15
Submitting multiple forms in Django
<form action="" method="post">
{% csrf_token %}
{{ form.as_ul }}
<button type="submit" name="form_1">Submit</button>
</form>
<form action="" method="post">
{% csrf_token %}
{{ form.as_ul }}
<button type="submit" name="form_2">Submit</button>
</form>
@jvorcak
jvorcak / gist:4751c6a572553ebf3d3738d5f7f5a7e2
Created September 19, 2019 10:07
git diff in real-time
watch --color -n 1 git diff --color
d = {'a':'Apple', 'b':'Banana','c':'Carrot'}
a,b,c = [d[k] for k in ('a', 'b','c')]
a == 'Apple'
b == 'Banana'
c == 'Carrot'
@jvorcak
jvorcak / clean-docker-images
Created May 23, 2019 05:22
Cleans old docker images
docker rmi $(docker images -f dangling=true -q)
https://stackoverflow.com/questions/14371376/how-do-you-make-many-files-public-in-google-cloud-storage
@jvorcak
jvorcak / kill-tmux-sessions.sh
Created May 3, 2019 07:06
kill specific tmux sessions based on awk expression
tmux list-sessions | awk 'BEGIN{FS=":"}{print $1}' | xargs -n 1 tmux kill-session -t
source (https://askubuntu.com/a/1014428)