Clean repo with respect to .gitignore file:
git rm -r --cached .
git add .
git commit -m "Clean with respect to .gitignore"
Configure a global .gitignore file:
git config --global core.excludesfile ~/.gitignore_global
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "startBackendServer", | |
"type": "shell", | |
"command": "${command:python.interpreterPath}", | |
"args": ["-m", | |
"flask", | |
"run", |
import rispy | |
entries_new = [] | |
with open('test.ris', 'r') as bibliography_file_in: | |
entries = rispy.load(bibliography_file_in) | |
for entry in entries: | |
entry_new = entry.copy() | |
if "keywords" in entry: |
import requests | |
def get_url_from_doi(doi): | |
"""Get the url from the DOI. | |
Arguments | |
--------- | |
doi: str | |
The DOI to find the url for. |
import xml.etree.ElementTree as ET | |
import requests | |
# curl -LH "Accept: application/vnd.datacite.datacite+xml" https://doi.org/10.34894/KEIQRD | |
def get_datapublisher_from_doi(doi): | |
"""Get the publisher from the DOI. | |
Arguments |
DATASET="van_de_schoot_2017" | |
QUERY_STRATEGIES=('max_random' 'max_uncertainty' 'max' 'uncertainty' 'random') | |
# ('max_random' 'max_uncertainty' 'max' 'uncertainty' 'random' 'cluster') | |
for qs in "${QUERY_STRATEGIES[@]}" | |
do | |
asreview simulate benchmark:${DATASET} -q $qs --seed 535 --init_seed 535 -s ${DATASET}_${qs}.h5 | |
asreview plot recall ${DATASET}_${qs}.h5 -o ${DATASET}_${qs}_recall.png |
Clean repo with respect to .gitignore file:
git rm -r --cached .
git add .
git commit -m "Clean with respect to .gitignore"
Configure a global .gitignore file:
git config --global core.excludesfile ~/.gitignore_global
"""Flickr photo downloader. | |
Get credentials for the Flickr API from | |
https://github.com/alexis-mignon/python-flickr-api/wiki/Flickr-API-Keys-and-Authentication | |
# a = flickr_api.auth.AuthHandler() | |
# perms = "read" # set the required permissions | |
# url = a.get_authorization_url(perms) | |
# <rsp stat="ok"> |
echo "Give a new version number (without v prefix)" | |
read version_tag | |
# create git tag | |
git tag -a "v${version_tag}" -m "Version ${version_tag}" | |
git push origin --tags | |
# reader pdf from markdown README. | |
pandoc README.md -o README.pdf |
This is helpful when running jupyter notebook on remote server (AWS) and tunneling into it, because with nohup the notebook process continues to run on the server even if you get disconnected from it (any running notebook code continues to run on the server without interruption, and just needs to be re-tunneled into).
In the remote server terminal, run:
nohup jupyter notebook &
[alias] | |
st = status | |
cm = commit -m | |
co = checkout | |
master = checkout master | |
br = branch | |
branches = branch -a | |
remote-tags = ls-remote --tags origin |