Skip to content

Instantly share code, notes, and snippets.

@jochenklar
jochenklar / 10000_questions.py
Created April 9, 2023 07:14
This script uses faker to create a set of catalogs with a lot of questions.
'''
# 10000 questions for RDMO
This script uses faker to create a set of catalogs with a lot of questions.
## Setup
```
cd rdmo-app
mkdir scripts
@jochenklar
jochenklar / zenodo_upload.py
Created June 28, 2021 18:31
Upload script for zenodo
#!/usr/bin/env python3
# needs to be installed with e.g. `pip install requests`
import requests
from pathlib import Path
access_token = '<access_token>'
url = 'https://zenodo.org/api/deposit/depositions/<id>'
path = Path('/path/to/the/files')
@jochenklar
jochenklar / reset.rdmo.sh
Last active November 28, 2022 09:41
A script to reset RDMO for development using rdmo-catalog fixtures.
#!/bin/bash
RDMO=~/code/rdmorganiser/rdmo
RDMO_CATALOG=~/code/rdmorganiser/rdmo-catalog
python manage.py print_settings | grep -E '^DEBUG\s*=\s(True)' > /dev/null
[ $? -ne 0 ] && echo 'DEBUG is not True' && exit 1
python manage.py check
[ $? -ne 0 ] && echo 'check failed' && exit 1
@jochenklar
jochenklar / reset.sh
Last active November 17, 2022 15:10
A script to reset RDMO for development using the testing fixtures.
#!/bin/bash
RDMO=~/code/rdmorganiser/rdmo
python manage.py print_settings | grep -E '^DEBUG\s*=\s(True)' > /dev/null
[ $? -ne 0 ] && echo 'DEBUG is not True' && exit 1
python manage.py check
[ $? -ne 0 ] && echo 'check failed' && exit 1
@jochenklar
jochenklar / detailed-list.json
Last active November 17, 2022 21:30
JSON list of all members of the european parliament
[
{
"id": "124990",
"full_name": "Lars ADAKTUSSON",
"first_names": [
"Lars"
],
"last_names": [
"Adaktusson"
],