- In a script called 'vimura':
#!/bin/sh
echo $1
zathura -s -x "gvim --servername $1 -c \"let g:syncpdf='$1'\" --remote +%{line} %{input}" $*
| """Demo of how to pop up plots asynchronously using separate processes.""" | |
| from multiprocessing import Process | |
| import time | |
| import sys | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| def demo(): | |
| i = 0 | |
| processes = [] |
| import math | |
| class Welford(object): | |
| """ Implements Welford's algorithm for computing a running mean | |
| and standard deviation as described at: | |
| http://www.johndcook.com/standard_deviation.html | |
| can take single values or iterables | |
| Properties: | |
| mean - returns the mean |
| #!/bin/bash | |
| # bash generate random alphanumeric string | |
| # | |
| # bash generate random 32 character alphanumeric string (upper and lowercase) and | |
| NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| # bash generate random 32 character alphanumeric string (lowercase only) | |
| cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
| # Based on http://unix.stackexchange.com/questions/14303/bash-cd-up-until-in-certain-folder/14311#14311 | |
| # Jump to closest matching parent directory | |
| upto () { | |
| if [ -z "$1" ]; then | |
| return | |
| fi | |
| local upto=$@ | |
| cd "${PWD/\/$upto\/*//$upto}" | |
| } | |
| # Auto-completion |
| import struct | |
| import SocketServer | |
| import sys | |
| from base64 import b64encode | |
| from hashlib import sha1 | |
| from mimetools import Message | |
| from StringIO import StringIO | |
| DEFAULT_PORT = 9999 |
| """ | |
| Read graphs in Open Street Maps osm format | |
| Based on osm.py from brianw's osmgeocode | |
| http://github.com/brianw/osmgeocode, which is based on osm.py from | |
| comes from Graphserver: | |
| http://github.com/bmander/graphserver/tree/master and is copyright (c) | |
| 2007, Brandon Martin-Anderson under the BSD License | |
| """ |
| """Simple example on how to log scalars and images to tensorboard without tensor ops. | |
| License: BSD License 2.0 | |
| """ | |
| __author__ = "Michael Gygli" | |
| import tensorflow as tf | |
| from StringIO import StringIO | |
| import matplotlib.pyplot as plt | |
| import numpy as np |
| # By default, Docker containers run as the root user. This is bad because: | |
| # 1) You're more likely to modify up settings that you shouldn't be | |
| # 2) If an attacker gets access to your container - well, that's bad if they're root. | |
| # Here's how you can run change a Docker container to run as a non-root user | |
| ## CREATE APP USER ## | |
| # Create the home directory for the new app user. | |
| RUN mkdir -p /home/app |
| """ | |
| Read directional graph from Open Street Maps osm format | |
| Based on the osm to networkx tool from aflaxman : https://gist.github.com/aflaxman/287370/ | |
| Use python3.6 | |
| Added : | |
| - : Python3.6 compatibility | |
| - : Cache for avoiding to download again the same osm tiles | |
| - : distance computation to estimate length of each ways (useful to compute the shortest path) |