I hereby claim:
- I am pavlov99 on github.
- I am p99 (https://keybase.io/p99) on keybase.
- I have a public key whose fingerprint is 247B E451 E71C 8AAD 6AF2 7842 5849 1A6C A92B 0F59
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| from functools import reduce | |
| def crossjoin(*dfs, **kwargs): | |
| """Calculate a cartesian product of given dataframes. | |
| Subsequently join each dataframe using a temporary constant key and then remove it. | |
| Also set a MultiIndex - cartesian product of the indices of the input dataframes. | |
| See: https://github.com/pydata/pandas/issues/5401 | |
| Args: |
| # Install madge (https://github.com/pahen/madge) and graphviz first | |
| madge --dot --layout neato --include-npm src/ | dot -Tpng > dependencies.png |
| # This command line executes all test files with NodeJS. | |
| # Test files are located in ./src folder and have *.spec.js | |
| # In order to use ES6 import/export syntax, reify is required: https://github.com/benjamn/reify | |
| # `find` command generates a "test file" which require() every actual test. | |
| # If the output is TAP-compatible, one could pipe it to ./node_modules/.bin/tap-mocha-reporter spec | |
| node --require reify -e "$(find ./src -name '*\.spec\.js' -type f -exec echo "require('{}');" \; | paste -s -d' ' -)" |
| #!/usr/bin/env bash | |
| # Update photo information: time and location. | |
| # After photo editing by agency, all of the meta tags were changed. This script fixes it. | |
| # Photos are ordered by filename, e.g. 001.jpg, 002.jpg, etc. The whole event happened | |
| # between 16:30 and 21:00 Moscow time on 30th June. Set time to every picture as if they were | |
| # taken uniformly during the event. | |
| # | |
| # See also: | |
| # exiftool https://www.sno.phy.queensu.ca/~phil/exiftool/ (allows batch editing as well). | |
| # https://www.latlong.net/ to find your location and get latitude and longitude info. |
| class Choices(object): | |
| """ Choices.""" | |
| def __init__(self, *choices): | |
| self._choices = [] | |
| self._choice_dict = {} | |
| for choice in choices: | |
| if isinstance(choice, (list, tuple)): |
| docker run -v "$(pwd)":/work mnuessler/pdftk *.pdf cat output combined.pdf |
| # Install linux pipe viewer and optional dialog | |
| sudo apt-get install dialog | |
| # Archive: | |
| tar cf - /folder-with-big-files -P | pv -s $(du -sb /folder-with-big-files | awk '{print $1}') | gzip > big-files.tar.gz | |
| # OSX: | |
| tar cf - /folder-with-big-files -P | pv -s $(($(du -sk /folder-with-big-files | awk '{print $1}') * 1024)) | gzip > big-files.tar.gz | |
| # Unarchive: | |
| pv file.tgz | tar xzf - -C target_directory |
| # Add gpg key: https://help.ubuntu.com/community/GnuPrivacyGuardHowto | |
| # Install GnuPG from https://www.gnupg.org/download/index.html | |
| gpg2 --full-generate-key | |
| # Delete gpg key | |
| gpg --delete-secret-key "User Name" | |
| gpg --delete-key "User Name" |
| $ ansible-galaxy info YourUser.RoleName | grep -E 'id: [0-9]' | awk {'print $2'} |