[
  {
    "path": ".gitignore",
    "content": ".idea/\npy3env/\n__pycache__/\n*.pyc\nconfig-personal.txt\ncards.db\nenv\n"
  },
  {
    "path": "Dockerfile",
    "content": "FROM python:3.9\nLABEL maintainer=\"Tinpee <tinpee.dev@gmail.com>\"\n\nADD . /src\nWORKDIR /src\nRUN pip install --upgrade pip \\\n    && pip install flask gunicorn\n\nCOPY entrypoint.sh /\nRUN sed -i 's/\\r$//' /entrypoint.sh\nRUN chmod +x /entrypoint.sh\n\nVOLUME /src/db\n\nEXPOSE 8000\nCMD [\"/entrypoint.sh\"]\n"
  },
  {
    "path": "README.md",
    "content": "# Computer Science Flash Cards\n\nThis is a little website I've put together to allow me to easily make flash cards and quiz myself for memorization of:\n\n- General cs knowledge\n  - vocabulary\n  - definitions of processes\n  - powers of 2\n  - design patterns\n- Code\n  - data structures\n  - algorithms\n  - solving problems\n  - bitwise operations\n\nWill be able to use it on:\n\n- desktop\n- mobile (phone and tablet)\n\nIt uses:\n\n- Python 3\n- Flask\n- SQLite\n\n---\n\n## About the Site\n\nHere's a brief rundown: https://startupnextdoor.com/flash-cards-site-complete/\n\n## Screenshots\n\nUI for listing cards. From here you can add and edit cards.\n\n![Card UI](screenshots/cards_ui-1467754141259.png)\n\n---\n\nThe front of a General flash card.\n\n![Memorizing general knowledge](screenshots/memorize_ui-1467754306971.png)\n\n---\n\nThe reverse (answer side) of a Code flash card.\n\n![Code view](screenshots/memorize_code-1467754962142.png)\n\n## Important Note\n\nThe set included in this project (**cards-jwasham.db**) is not my full set, and is way too big already.\n\nThanks for asking for my list of 1,792 cards. But **it’s too much.** I even printed them out. It’s 50 pages, front and back, in tiny text. It would take about 8 hours to just read them all.\n\nMy set includes a lot of obscure info from books I’ve read, Python trivia, machine learning knowledge, assembly language, etc.\n\nI've added it to the project if you want it (**cards-jwasham-extreme.db**). You've been warned.\n\nPlease make your own set, and while you’re making them, only make cards for what you need to know. Otherwise, it gets out of hand.\n\n## How to convert to Anki or CSV\n\nIf you don't want to run a server, you can simply use Anki or a similar service/app. Use this script to convert from my sets (SQLite .db file), or yours, to CSV:\n\nhttps://github.com/eyedol/tools/blob/master/anki_data_builder.py\n\nThanks [@eyedol](https://github.com/eyedol)\n\n## Anki Flashcards:\n\n* [computer science flash cards - (basic)](https://ankiweb.net/shared/info/1782040640)\n* [computer science flash cards - (extreme)](https://ankiweb.net/shared/info/1691396127)\n\nThanks [@JackKuo-tw](https://github.com/JackKuo-tw)\n\n## How to run it on a server\n\n1. Clone project to a directory on your web server.\n1. Edit the config.txt file. Change the secret key, username and password. The username and password will be the login\n    for your site. There is only one user - you.\n1. Follow this long tutorial to get Flask running. It was way more work than it should be:\n    https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-16-04\n    - `wsgi.py` is the entry point. It calls `flash_cards.py`\n    - This is my systemd file `/etc/systemd/system/flash_cards.service`: [view](flash_cards.service)\n        - you can see the paths where I installed it, and the name of my virtualenv directory\n    - when done with tutorial:\n    ```shell\n    sudo systemctl restart flash_cards\n    sudo systemctl daemon-reload\n    ```\n1. When you see a login page, you're good to go.\n1. Log in.\n1. Click the \"General\" or \"Code\" button and make a card!\n1. When you're ready to start memorizing, click either \"General\" or \"Code\"\n    in the top menu.\n\n## How to run it on local host (Quick Guide)\n\n*Provided by [@devyash](https://github.com/devyash) - devyashsanghai@gmail.com - Reach out to this contributor if you have trouble.*\n\n1. Install dependencies:\n   1. Install [Python](https://www.python.org/download/releases)\n   1. Add python as environment variable [windows](http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7)\n   1. To install pip, securely download [get-pip.py](https://bootstrap.pypa.io/get-pip.py)\n   1. Run `python get-pip.py` in terminal\n   1. Add pip to your PATH system variable [windows](https://stackoverflow.com/questions/23708898/pip-is-not-recognized-as-an-internal-or-external-command)\n   1. Run `pip install -r requirements.txt` in terminal after going to correct folder\n1. Type `python flash_cards.py` - if you get error for flask then use `python -m pip install Flask` first then run `flash_card.py` file\n1. Open localhost:5000/\n1. Login using 'admin' and 'default' for the username and password, respectively.\n\n**NOTE:** If you wish to use John's flash cards then also do following steps:\n\n1. Copy db files such as `cards-jwasham-extreme` OR `cards-jwasham` and paste them in db folder\n1. Edit file `flash_cards.py` line 8 and replace 'cards.db' with any of the other database files e.g.('cards-jwasham.db') \n1. Repeat the above steps from step 3\n\nEvery time you wish to run your db just open folder in terminal and run  `python flash_cards.py`\n\n## How to run with Docker\n\n*Provided by [@Tinpee](https://github.com/tinpee) - tinpee.dev@gmail.com - Reach out to this contributor if you have trouble.*\n\n__Make sure you already installed [docker](https://www.docker.com) and optionally [docker-compose](https://docs.docker.com/compose/install/)__\n\n1. Clone project to any where you want and go to source folder.\n1. Edit the `config.txt` file. Change the secret key, username and password. The username and password will be the login for your site. There is only one user - you.\n1. Build image:\n   - Docker: `docker build . -t cs-flash-cards`\n   - Compose: `docker-compose build`\n1. Run container:\n   - Docker: `docker run -d -p 8000:8000 --name cs-flash-cards cs-flash-cards`\n   - Compose: `docker-compose up`\n1. Go your browser and type `http://localhost:8000`\n\n__If you already had a backup file `cards.db`. Run following command:__\n\n*Note: We don't need to rebuild image, just delete old container if you already built.*\n\n```shell\ndocker run -d -p 8000:8000 --name cs-flash-cards -v <path_to_folder_contains_cards_db>:/src/db cs-flash-cards\n```\n\n- `<path_to_folder_contains_cards_db>`: is the full path contains `cards.db`.\n- Example: `/home/tinpee/cs-flash-cards/db`, and `cards.db` is inside this folder.\n\nFor convenience, if you don't have `cards.db`, this container will auto copy a new one from `cards-empty.db`.\n\n---\n\n### How to backup data ?\nWe just need store `cards.db` file, and don't need any sql command.\n- If you run container with `-v <folder_db>:/src/db` just go to `folder_db` and store `cards.db` anywhere you want.\n- Without `-v flag`. Type: `docker cp <name_of_container>:/src/db/cards.db /path/to/save`\n\n### How to restore data ?\n- Delete old container (not image): `docker rm cs-flash-cards`\n- Build a new one with `-v flag`:\n`docker run -d -p 8000:8000 --name cs-flash-cards -v <path_to_folder_contains_cards_db>:/src/db cs-flash-cards`\n- Voila :)\n\n### How to deploy docker file on heroku\n\n- first install [heroku CLI](https://devcenter.heroku.com/articles/heroku-cli)\n- change `entrypoint.sh`\n\n```shell\n- export CARDS_SETTINGS=/src/config.txt\ngunicorn --bind  0.0.0.0:$8000 flash_cards:app\n+ export CARDS_SETTINGS=/src/config.txt\ngunicorn --bind  0.0.0.0:$PORT flash_cards:app\n```\n- deploy docker file with following commands\n\n```shell\nheroku login\nheroku container:login\nheroku create\n# Creating app... done, ⬢ your-app-name\nheroku container:push web --app your-app-name\nheroku container:release web --app your-app-name\nheroku open --app your-app-name\n```\n\n## Alternative for Node fans\n\n[@ashwanikumar04](https://github.com/ashwanikumar04) put together an alternative flash cards site running Node: https://github.com/ashwanikumar04/flash-cards\n\nCheck out the demo!\n\n*Happy learning!*\n"
  },
  {
    "path": "config.txt",
    "content": "SECRET_KEY='some very long key here'\nUSERNAME='username-test'\nPASSWORD='password-test'"
  },
  {
    "path": "data/handle_old_schema.sql",
    "content": "create table if not exists tags (\n  id integer primary key autoincrement,\n  tagName text not null\n);"
  },
  {
    "path": "data/schema.sql",
    "content": "-- drop table if exists cards;\ncreate table cards (\n  id integer primary key autoincrement,\n  type tinyint not null, /* 1 for vocab, 2 for code */\n  front text not null,\n  back text not null,\n  known boolean default 0\n);\n\ncreate table tags (\n  id integer primary key autoincrement,\n  tagName text not null\n);\n"
  },
  {
    "path": "db/.gitkeep",
    "content": ""
  },
  {
    "path": "docker-compose.yml",
    "content": "version: '3'\n\nservices:\n\n  cs-flash-cards:\n    build: .\n    ports:\n      - 8000:8000\n    volumes:\n      - ./cards-empty.db:/src/db/cards.db\n#      - ./cards-jwasham-extreme.db:/src/db/cards.db\n#      - ./cards-jwasham.db:/src/db/cards.db\n"
  },
  {
    "path": "entrypoint.sh",
    "content": "#!/bin/bash\n\nif [ ! -f /src/db/cards.db ]; then\n\tcp cards-empty.db /src/db/cards.db\nfi\n\nexport CARDS_SETTINGS=/src/config.txt\ngunicorn --bind  0.0.0.0:8000 flash_cards:app"
  },
  {
    "path": "flash_cards.ini",
    "content": "[uwsgi]\nmodule = wsgi:app\n\nmaster = true\nprocesses = 5\n\nsocket = flash_cards.sock\nchmod-socket = 660\nvacuum = true\n\ndie-on-term = true\n\n\n"
  },
  {
    "path": "flash_cards.py",
    "content": "import os\nimport sqlite3\nfrom flask import Flask, request, session, g, redirect, url_for, abort, \\\n    render_template, flash\n\napp = Flask(__name__)\napp.config.from_object(__name__)\nnameDB='cards.db'\npathDB='db'\n\ndef load_config():\n    app.config.update(dict(\n        DATABASE=os.path.join(app.root_path, pathDB, nameDB),\n        SECRET_KEY='development key',\n        USERNAME='admin',\n        PASSWORD='default'\n    ))\n    app.config.from_envvar('CARDS_SETTINGS', silent=True)\n\nif __name__ == \"__main__\" or __name__ == \"flash_cards\":\n    load_config()\n\ndef connect_db():\n    rv = sqlite3.connect(app.config['DATABASE'])\n    rv.row_factory = sqlite3.Row\n    return rv\n\n\ndef init_db():\n    db = get_db()\n    with app.open_resource('data/schema.sql', mode='r') as f:\n        db.cursor().executescript(f.read())\n    db.commit()\n\ndef get_db():\n    \"\"\"Opens a new database connection if there is none yet for the\n    current application context.\n    \"\"\"\n    if not hasattr(g, 'sqlite_db'):\n        g.sqlite_db = connect_db()\n    return g.sqlite_db\n\n\n@app.teardown_appcontext\ndef close_db(error):\n    \"\"\"Closes the database again at the end of the request.\"\"\"\n    if hasattr(g, 'sqlite_db'):\n        g.sqlite_db.close()\n\n@app.route('/')\ndef index():\n    if session.get('logged_in'):\n        return redirect(url_for('list_db'))\n    else:\n        return redirect(url_for('login'))\n\n\n@app.route('/cards')\ndef cards():\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    db = get_db()\n    query = '''\n        SELECT id, type, front, back, known\n        FROM cards\n        ORDER BY id DESC\n    '''\n    cur = db.execute(query)\n    cards = cur.fetchall()\n    tags = getAllTag()\n    return render_template('cards.html', cards=cards, tags=tags, filter_name=\"all\")\n\n\n@app.route('/filter_cards/<filter_name>')\ndef filter_cards(filter_name):\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n\n    filters = {\n        \"all\":      \"where 1 = 1\",\n        \"general\":  \"where type = 1\",\n        \"code\":     \"where type = 2\",\n        \"known\":    \"where known = 1\",\n        \"unknown\":  \"where known = 0\",\n    }\n\n    query = filters.get(filter_name)\n    if(query is None):\n        query = \"where type = {0}\".format(filter_name)\n        filter_name = int(filter_name)\n\n    if not query:\n        return redirect(url_for('show'))\n\n    db = get_db()\n    fullquery = \"SELECT id, type, front, back, known FROM cards \" + \\\n        query + \" ORDER BY id DESC\"\n    cur = db.execute(fullquery)\n    cards = cur.fetchall()\n    tags = getAllTag()\n    return render_template('show.html', cards=cards, tags=tags, filter_name=filter_name)\n\n\n@app.route('/add', methods=['POST'])\ndef add_card():\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    db = get_db()\n    db.execute('INSERT INTO cards (type, front, back) VALUES (?, ?, ?)',\n               [request.form['type'],\n                request.form['front'],\n                request.form['back']\n                ])\n    db.commit()\n    flash('New card was successfully added.')\n    return redirect(url_for('cards'))\n\n\n@app.route('/edit/<card_id>')\ndef edit(card_id):\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    db = get_db()\n    query = '''\n        SELECT id, type, front, back, known\n        FROM cards\n        WHERE id = ?\n    '''\n    cur = db.execute(query, [card_id])\n    card = cur.fetchone()\n    tags = getAllTag()\n    return render_template('edit.html', card=card, tags=tags)\n\n\n@app.route('/edit_card', methods=['POST'])\ndef edit_card():\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    selected = request.form.getlist('known')\n    known = bool(selected)\n    db = get_db()\n    command = '''\n        UPDATE cards\n        SET\n          type = ?,\n          front = ?,\n          back = ?,\n          known = ?\n        WHERE id = ?\n    '''\n    db.execute(command,\n               [request.form['type'],\n                request.form['front'],\n                request.form['back'],\n                known,\n                request.form['card_id']\n                ])\n    db.commit()\n    flash('Card saved.')\n    return redirect(url_for('show'))\n\n\n@app.route('/delete/<card_id>')\ndef delete(card_id):\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    db = get_db()\n    db.execute('DELETE FROM cards WHERE id = ?', [card_id])\n    db.commit()\n    flash('Card deleted.')\n    return redirect(url_for('cards'))\n\n@app.route('/memorize')\n@app.route('/memorize/<card_type>')\n@app.route('/memorize/<card_type>/<card_id>')\ndef memorize(card_type, card_id=None):\n    tag = getTag(card_type)\n    if tag is None:\n        return redirect(url_for('cards'))\n\n    if card_id:\n        card = get_card_by_id(card_id)\n    else:\n        card = get_card(card_type)\n    if not card:\n        flash(\"You've learned all the '\" + tag[1] + \"' cards.\")\n        return redirect(url_for('show'))\n    short_answer = (len(card['back']) < 75)\n    tags = getAllTag()\n    card_type = int(card_type)\n    return render_template('memorize.html',\n                           card=card,\n                           card_type=card_type,\n                           short_answer=short_answer, tags=tags)\n\n@app.route('/memorize_known')\n@app.route('/memorize_known/<card_type>')\n@app.route('/memorize_known/<card_type>/<card_id>')\ndef memorize_known(card_type, card_id=None):\n    tag = getTag(card_type)\n    if tag is None:\n        return redirect(url_for('cards'))\n\n    if card_id:\n        card = get_card_by_id(card_id)\n    else:\n        card = get_card_already_known(card_type)\n    if not card:\n        flash(\"You haven't learned any '\" + tag[1] + \"' cards yet.\")\n        return redirect(url_for('show'))\n    short_answer = (len(card['back']) < 75)\n    tags = getAllTag()\n    card_type = int(card_type)\n    return render_template('memorize_known.html',\n                           card=card,\n                           card_type=card_type,\n                           short_answer=short_answer, tags=tags)\n\n\ndef get_card(type):\n    db = get_db()\n\n    query = '''\n      SELECT\n        id, type, front, back, known\n      FROM cards\n      WHERE\n        type = ?\n        and known = 0\n      ORDER BY RANDOM()\n      LIMIT 1\n    '''\n\n    cur = db.execute(query, [type])\n    return cur.fetchone()\n\n\ndef get_card_by_id(card_id):\n    db = get_db()\n\n    query = '''\n      SELECT\n        id, type, front, back, known\n      FROM cards\n      WHERE\n        id = ?\n      LIMIT 1\n    '''\n\n    cur = db.execute(query, [card_id])\n    return cur.fetchone()\n\n\n@app.route('/mark_known/<card_id>/<card_type>')\ndef mark_known(card_id, card_type):\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    db = get_db()\n    db.execute('UPDATE cards SET known = 1 WHERE id = ?', [card_id])\n    db.commit()\n    flash('Card marked as known.')\n    return redirect(url_for('memorize', card_type=card_type))\n\n@app.route('/login', methods=['GET', 'POST'])\ndef login():\n    error = None\n    if request.method == 'POST':\n        if request.form['username'] != app.config['USERNAME']:\n            error = 'Invalid username or password!'\n        elif request.form['password'] != app.config['PASSWORD']:\n            error = 'Invalid username or password!'\n        else:\n            session['logged_in'] = True\n            session.permanent = True  # stay logged in\n            return redirect(url_for('index'))\n    return render_template('login.html', error=error)\n\n\n@app.route('/logout')\ndef logout():\n    session.pop('logged_in', None)\n    flash(\"You've logged out\")\n    return redirect(url_for('index'))\n\n\ndef getAllTag():\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    db = get_db()\n    query = '''\n        SELECT id, tagName\n        FROM tags\n        ORDER BY id ASC\n    '''\n    cur = db.execute(query)\n    tags = cur.fetchall()\n    return tags\n\n\n@app.route('/tags')\ndef tags():\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    tags = getAllTag()\n    return render_template('tags.html', tags=tags, filter_name=\"all\")\n\n\n@app.route('/addTag', methods=['POST'])\ndef add_tag():\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    db = get_db()\n    db.execute('INSERT INTO tags (tagName) VALUES (?)',\n               [request.form['tagName']])\n    db.commit()\n    flash('New tag was successfully added.')\n    return redirect(url_for('tags'))\n\n\n@app.route('/editTag/<tag_id>')\ndef edit_tag(tag_id):\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    tag = getTag(tag_id)\n    return render_template('editTag.html', tag=tag)\n\n\n@app.route('/updateTag', methods=['POST'])\ndef update_tag():\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    db = get_db()\n    command = '''\n        UPDATE tags\n        SET\n          tagName = ?\n        WHERE id = ?\n    '''\n    db.execute(command,\n               [request.form['tagName'],\n                request.form['tag_id']\n                ])\n    db.commit()\n    flash('Tag saved.')\n    return redirect(url_for('tags'))\n\ndef init_tag():\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    db = get_db()\n    db.execute('INSERT INTO tags (tagName) VALUES (?)',\n               [\"general\"])\n    db.commit()\n    db.execute('INSERT INTO tags (tagName) VALUES (?)',\n               [\"code\"])\n    db.commit()\n    db.execute('INSERT INTO tags (tagName) VALUES (?)',\n               [\"bookmark\"])\n    db.commit()\n\n@app.route('/show')\ndef show():\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    tags = getAllTag()\n    return render_template('show.html', tags=tags, filter_name=\"\")\n\ndef getTag(tag_id):\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    db = get_db()\n    query = '''\n        SELECT id, tagName\n        FROM tags\n        WHERE id = ?\n    '''\n    cur = db.execute(query, [tag_id])\n    tag = cur.fetchone()\n    return tag\n\n@app.route('/bookmark/<card_type>/<card_id>')\ndef bookmark(card_type, card_id):\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    db = get_db()\n    db.execute('UPDATE cards SET type = ? WHERE id = ?',[card_type,card_id])\n    db.commit()\n    flash('Card saved.')\n    return redirect(url_for('memorize', card_type=card_type))\n\n@app.route('/list_db')\ndef list_db():\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    dbs = [f for f in os.listdir(pathDB) if os.path.isfile(os.path.join(pathDB, f))]\n    dbs = list(filter(lambda k: '.db' in k, dbs))\n    return render_template('listDb.html', dbs=dbs)\n\n@app.route('/load_db/<name>')\ndef load_db(name):\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    global nameDB\n    nameDB=name\n    load_config()\n    handle_old_schema()\n    return redirect(url_for('memorize', card_type=\"1\"))\n\n@app.route('/create_db')\ndef create_db():\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    return render_template('createDb.html')\n\n@app.route('/init', methods=['POST'])\ndef init():\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    global nameDB\n    nameDB = request.form['dbName'] + '.db'\n    load_config()\n    init_db()\n    init_tag()\n    return redirect(url_for('index'))\n\ndef check_table_tag_exists():\n    db = get_db()\n    cur = db.execute(\"SELECT name FROM sqlite_master WHERE type='table' AND name='tags'\")\n    result = cur.fetchone()\n    return result\n\ndef create_tag_table():\n    db = get_db()\n    with app.open_resource('data/handle_old_schema.sql', mode='r') as f:\n        db.cursor().executescript(f.read())\n    db.commit()\n\ndef handle_old_schema():\n    result = check_table_tag_exists()\n    if(result is None):\n        create_tag_table()\n        init_tag()\n\ndef get_card_already_known(type):\n    db = get_db()\n\n    query = '''\n      SELECT\n        id, type, front, back, known\n      FROM cards\n      WHERE\n        type = ?\n        and known = 1\n      ORDER BY RANDOM()\n      LIMIT 1\n    '''\n\n    cur = db.execute(query, [type])\n    return cur.fetchone()\n\n@app.route('/mark_unknown/<card_id>/<card_type>')\ndef mark_unknown(card_id, card_type):\n    if not session.get('logged_in'):\n        return redirect(url_for('login'))\n    db = get_db()\n    db.execute('UPDATE cards SET known = 0 WHERE id = ?', [card_id])\n    db.commit()\n    flash('Card marked as unknown.')\n    return redirect(url_for('memorize_known', card_type=card_type))\n\nif __name__ == '__main__':\n    app.run(host='0.0.0.0')\n"
  },
  {
    "path": "flash_cards.service",
    "content": "[Unit]\nDescription=uWSGI instance to serve flash_cards\nAfter=network.target\n\n[Service]\nUser=john\nGroup=www-data\nWorkingDirectory=/var/www/cs_flash_cards\nEnvironment=\"PATH=/var/www/cs_flash_cards/py3env/bin\"\nEnvironment=\"CARDS_SETTINGS=/var/www/cs_flash_cards/config-personal.txt\"\nExecStart=/var/www/cs_flash_cards/py3env/bin/uwsgi --ini flash_cards.ini\n\n[Install]\nWantedBy=multi-user.target"
  },
  {
    "path": "license.md",
    "content": "Attribution-ShareAlike 4.0 International\n\n=======================================================================\n\nCreative Commons Corporation (\"Creative Commons\") is not a law firm and\ndoes not provide legal services or legal advice. Distribution of\nCreative Commons public licenses does not create a lawyer-client or\nother relationship. Creative Commons makes its licenses and related\ninformation available on an \"as-is\" basis. Creative Commons gives no\nwarranties regarding its licenses, any material licensed under their\nterms and conditions, or any related information. Creative Commons\ndisclaims all liability for damages resulting from their use to the\nfullest extent possible.\n\nUsing Creative Commons Public Licenses\n\nCreative Commons public licenses provide a standard set of terms and\nconditions that creators and other rights holders may use to share\noriginal works of authorship and other material subject to copyright\nand certain other rights specified in the public license below. The\nfollowing considerations are for informational purposes only, are not\nexhaustive, and do not form part of our licenses.\n\n     Considerations for licensors: Our public licenses are\n     intended for use by those authorized to give the public\n     permission to use material in ways otherwise restricted by\n     copyright and certain other rights. Our licenses are\n     irrevocable. Licensors should read and understand the terms\n     and conditions of the license they choose before applying it.\n     Licensors should also secure all rights necessary before\n     applying our licenses so that the public can reuse the\n     material as expected. Licensors should clearly mark any\n     material not subject to the license. This includes other CC-\n     licensed material, or material used under an exception or\n     limitation to copyright. More considerations for licensors:\n\twiki.creativecommons.org/Considerations_for_licensors\n\n     Considerations for the public: By using one of our public\n     licenses, a licensor grants the public permission to use the\n     licensed material under specified terms and conditions. If\n     the licensor's permission is not necessary for any reason--for\n     example, because of any applicable exception or limitation to\n     copyright--then that use is not regulated by the license. Our\n     licenses grant only permissions under copyright and certain\n     other rights that a licensor has authority to grant. Use of\n     the licensed material may still be restricted for other\n     reasons, including because others have copyright or other\n     rights in the material. A licensor may make special requests,\n     such as asking that all changes be marked or described.\n     Although not required by our licenses, you are encouraged to\n     respect those requests where reasonable. More_considerations\n     for the public:\n\twiki.creativecommons.org/Considerations_for_licensees\n\n=======================================================================\n\nCreative Commons Attribution-ShareAlike 4.0 International Public\nLicense\n\nBy exercising the Licensed Rights (defined below), You accept and agree\nto be bound by the terms and conditions of this Creative Commons\nAttribution-ShareAlike 4.0 International Public License (\"Public\nLicense\"). To the extent this Public License may be interpreted as a\ncontract, You are granted the Licensed Rights in consideration of Your\nacceptance of these terms and conditions, and the Licensor grants You\nsuch rights in consideration of benefits the Licensor receives from\nmaking the Licensed Material available under these terms and\nconditions.\n\n\nSection 1 -- Definitions.\n\n  a. Adapted Material means material subject to Copyright and Similar\n     Rights that is derived from or based upon the Licensed Material\n     and in which the Licensed Material is translated, altered,\n     arranged, transformed, or otherwise modified in a manner requiring\n     permission under the Copyright and Similar Rights held by the\n     Licensor. For purposes of this Public License, where the Licensed\n     Material is a musical work, performance, or sound recording,\n     Adapted Material is always produced where the Licensed Material is\n     synched in timed relation with a moving image.\n\n  b. Adapter's License means the license You apply to Your Copyright\n     and Similar Rights in Your contributions to Adapted Material in\n     accordance with the terms and conditions of this Public License.\n\n  c. BY-SA Compatible License means a license listed at\n     creativecommons.org/compatiblelicenses, approved by Creative\n     Commons as essentially the equivalent of this Public License.\n\n  d. Copyright and Similar Rights means copyright and/or similar rights\n     closely related to copyright including, without limitation,\n     performance, broadcast, sound recording, and Sui Generis Database\n     Rights, without regard to how the rights are labeled or\n     categorized. For purposes of this Public License, the rights\n     specified in Section 2(b)(1)-(2) are not Copyright and Similar\n     Rights.\n\n  e. Effective Technological Measures means those measures that, in the\n     absence of proper authority, may not be circumvented under laws\n     fulfilling obligations under Article 11 of the WIPO Copyright\n     Treaty adopted on December 20, 1996, and/or similar international\n     agreements.\n\n  f. Exceptions and Limitations means fair use, fair dealing, and/or\n     any other exception or limitation to Copyright and Similar Rights\n     that applies to Your use of the Licensed Material.\n\n  g. License Elements means the license attributes listed in the name\n     of a Creative Commons Public License. The License Elements of this\n     Public License are Attribution and ShareAlike.\n\n  h. Licensed Material means the artistic or literary work, database,\n     or other material to which the Licensor applied this Public\n     License.\n\n  i. Licensed Rights means the rights granted to You subject to the\n     terms and conditions of this Public License, which are limited to\n     all Copyright and Similar Rights that apply to Your use of the\n     Licensed Material and that the Licensor has authority to license.\n\n  j. Licensor means the individual(s) or entity(ies) granting rights\n     under this Public License.\n\n  k. Share means to provide material to the public by any means or\n     process that requires permission under the Licensed Rights, such\n     as reproduction, public display, public performance, distribution,\n     dissemination, communication, or importation, and to make material\n     available to the public including in ways that members of the\n     public may access the material from a place and at a time\n     individually chosen by them.\n\n  l. Sui Generis Database Rights means rights other than copyright\n     resulting from Directive 96/9/EC of the European Parliament and of\n     the Council of 11 March 1996 on the legal protection of databases,\n     as amended and/or succeeded, as well as other essentially\n     equivalent rights anywhere in the world.\n\n  m. You means the individual or entity exercising the Licensed Rights\n     under this Public License. Your has a corresponding meaning.\n\n\nSection 2 -- Scope.\n\n  a. License grant.\n\n       1. Subject to the terms and conditions of this Public License,\n          the Licensor hereby grants You a worldwide, royalty-free,\n          non-sublicensable, non-exclusive, irrevocable license to\n          exercise the Licensed Rights in the Licensed Material to:\n\n            a. reproduce and Share the Licensed Material, in whole or\n               in part; and\n\n            b. produce, reproduce, and Share Adapted Material.\n\n       2. Exceptions and Limitations. For the avoidance of doubt, where\n          Exceptions and Limitations apply to Your use, this Public\n          License does not apply, and You do not need to comply with\n          its terms and conditions.\n\n       3. Term. The term of this Public License is specified in Section\n          6(a).\n\n       4. Media and formats; technical modifications allowed. The\n          Licensor authorizes You to exercise the Licensed Rights in\n          all media and formats whether now known or hereafter created,\n          and to make technical modifications necessary to do so. The\n          Licensor waives and/or agrees not to assert any right or\n          authority to forbid You from making technical modifications\n          necessary to exercise the Licensed Rights, including\n          technical modifications necessary to circumvent Effective\n          Technological Measures. For purposes of this Public License,\n          simply making modifications authorized by this Section 2(a)\n          (4) never produces Adapted Material.\n\n       5. Downstream recipients.\n\n            a. Offer from the Licensor -- Licensed Material. Every\n               recipient of the Licensed Material automatically\n               receives an offer from the Licensor to exercise the\n               Licensed Rights under the terms and conditions of this\n               Public License.\n\n            b. Additional offer from the Licensor -- Adapted Material.\n               Every recipient of Adapted Material from You\n               automatically receives an offer from the Licensor to\n               exercise the Licensed Rights in the Adapted Material\n               under the conditions of the Adapter's License You apply.\n\n            c. No downstream restrictions. You may not offer or impose\n               any additional or different terms or conditions on, or\n               apply any Effective Technological Measures to, the\n               Licensed Material if doing so restricts exercise of the\n               Licensed Rights by any recipient of the Licensed\n               Material.\n\n       6. No endorsement. Nothing in this Public License constitutes or\n          may be construed as permission to assert or imply that You\n          are, or that Your use of the Licensed Material is, connected\n          with, or sponsored, endorsed, or granted official status by,\n          the Licensor or others designated to receive attribution as\n          provided in Section 3(a)(1)(A)(i).\n\n  b. Other rights.\n\n       1. Moral rights, such as the right of integrity, are not\n          licensed under this Public License, nor are publicity,\n          privacy, and/or other similar personality rights; however, to\n          the extent possible, the Licensor waives and/or agrees not to\n          assert any such rights held by the Licensor to the limited\n          extent necessary to allow You to exercise the Licensed\n          Rights, but not otherwise.\n\n       2. Patent and trademark rights are not licensed under this\n          Public License.\n\n       3. To the extent possible, the Licensor waives any right to\n          collect royalties from You for the exercise of the Licensed\n          Rights, whether directly or through a collecting society\n          under any voluntary or waivable statutory or compulsory\n          licensing scheme. In all other cases the Licensor expressly\n          reserves any right to collect such royalties.\n\n\nSection 3 -- License Conditions.\n\nYour exercise of the Licensed Rights is expressly made subject to the\nfollowing conditions.\n\n  a. Attribution.\n\n       1. If You Share the Licensed Material (including in modified\n          form), You must:\n\n            a. retain the following if it is supplied by the Licensor\n               with the Licensed Material:\n\n                 i. identification of the creator(s) of the Licensed\n                    Material and any others designated to receive\n                    attribution, in any reasonable manner requested by\n                    the Licensor (including by pseudonym if\n                    designated);\n\n                ii. a copyright notice;\n\n               iii. a notice that refers to this Public License;\n\n                iv. a notice that refers to the disclaimer of\n                    warranties;\n\n                 v. a URI or hyperlink to the Licensed Material to the\n                    extent reasonably practicable;\n\n            b. indicate if You modified the Licensed Material and\n               retain an indication of any previous modifications; and\n\n            c. indicate the Licensed Material is licensed under this\n               Public License, and include the text of, or the URI or\n               hyperlink to, this Public License.\n\n       2. You may satisfy the conditions in Section 3(a)(1) in any\n          reasonable manner based on the medium, means, and context in\n          which You Share the Licensed Material. For example, it may be\n          reasonable to satisfy the conditions by providing a URI or\n          hyperlink to a resource that includes the required\n          information.\n\n       3. If requested by the Licensor, You must remove any of the\n          information required by Section 3(a)(1)(A) to the extent\n          reasonably practicable.\n\n  b. ShareAlike.\n\n     In addition to the conditions in Section 3(a), if You Share\n     Adapted Material You produce, the following conditions also apply.\n\n       1. The Adapter's License You apply must be a Creative Commons\n          license with the same License Elements, this version or\n          later, or a BY-SA Compatible License.\n\n       2. You must include the text of, or the URI or hyperlink to, the\n          Adapter's License You apply. You may satisfy this condition\n          in any reasonable manner based on the medium, means, and\n          context in which You Share Adapted Material.\n\n       3. You may not offer or impose any additional or different terms\n          or conditions on, or apply any Effective Technological\n          Measures to, Adapted Material that restrict exercise of the\n          rights granted under the Adapter's License You apply.\n\n\nSection 4 -- Sui Generis Database Rights.\n\nWhere the Licensed Rights include Sui Generis Database Rights that\napply to Your use of the Licensed Material:\n\n  a. for the avoidance of doubt, Section 2(a)(1) grants You the right\n     to extract, reuse, reproduce, and Share all or a substantial\n     portion of the contents of the database;\n\n  b. if You include all or a substantial portion of the database\n     contents in a database in which You have Sui Generis Database\n     Rights, then the database in which You have Sui Generis Database\n     Rights (but not its individual contents) is Adapted Material,\n\n     including for purposes of Section 3(b); and\n  c. You must comply with the conditions in Section 3(a) if You Share\n     all or a substantial portion of the contents of the database.\n\nFor the avoidance of doubt, this Section 4 supplements and does not\nreplace Your obligations under this Public License where the Licensed\nRights include other Copyright and Similar Rights.\n\n\nSection 5 -- Disclaimer of Warranties and Limitation of Liability.\n\n  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE\n     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS\n     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF\n     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,\n     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,\n     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR\n     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,\n     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT\n     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT\n     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.\n\n  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE\n     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,\n     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,\n     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,\n     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR\n     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN\n     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR\n     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR\n     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.\n\n  c. The disclaimer of warranties and limitation of liability provided\n     above shall be interpreted in a manner that, to the extent\n     possible, most closely approximates an absolute disclaimer and\n     waiver of all liability.\n\n\nSection 6 -- Term and Termination.\n\n  a. This Public License applies for the term of the Copyright and\n     Similar Rights licensed here. However, if You fail to comply with\n     this Public License, then Your rights under this Public License\n     terminate automatically.\n\n  b. Where Your right to use the Licensed Material has terminated under\n     Section 6(a), it reinstates:\n\n       1. automatically as of the date the violation is cured, provided\n          it is cured within 30 days of Your discovery of the\n          violation; or\n\n       2. upon express reinstatement by the Licensor.\n\n     For the avoidance of doubt, this Section 6(b) does not affect any\n     right the Licensor may have to seek remedies for Your violations\n     of this Public License.\n\n  c. For the avoidance of doubt, the Licensor may also offer the\n     Licensed Material under separate terms or conditions or stop\n     distributing the Licensed Material at any time; however, doing so\n     will not terminate this Public License.\n\n  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public\n     License.\n\n\nSection 7 -- Other Terms and Conditions.\n\n  a. The Licensor shall not be bound by any additional or different\n     terms or conditions communicated by You unless expressly agreed.\n\n  b. Any arrangements, understandings, or agreements regarding the\n     Licensed Material not stated herein are separate from and\n     independent of the terms and conditions of this Public License.\n\n\nSection 8 -- Interpretation.\n\n  a. For the avoidance of doubt, this Public License does not, and\n     shall not be interpreted to, reduce, limit, restrict, or impose\n     conditions on any use of the Licensed Material that could lawfully\n     be made without permission under this Public License.\n\n  b. To the extent possible, if any provision of this Public License is\n     deemed unenforceable, it shall be automatically reformed to the\n     minimum extent necessary to make it enforceable. If the provision\n     cannot be reformed, it shall be severed from this Public License\n     without affecting the enforceability of the remaining terms and\n     conditions.\n\n  c. No term or condition of this Public License will be waived and no\n     failure to comply consented to unless expressly agreed to by the\n     Licensor.\n\n  d. Nothing in this Public License constitutes or may be interpreted\n     as a limitation upon, or waiver of, any privileges and immunities\n     that apply to the Licensor or You, including from the legal\n     processes of any jurisdiction or authority.\n\n\n=======================================================================\n\nCreative Commons is not a party to its public\nlicenses. Notwithstanding, Creative Commons may elect to apply one of\nits public licenses to material it publishes and in those instances\nwill be considered the “Licensor.” The text of the Creative Commons\npublic licenses is dedicated to the public domain under the CC0 Public\nDomain Dedication. Except for the limited purpose of indicating that\nmaterial is shared under a Creative Commons public license or as\notherwise permitted by the Creative Commons policies published at\ncreativecommons.org/policies, Creative Commons does not authorize the\nuse of the trademark \"Creative Commons\" or any other trademark or logo\nof Creative Commons without its prior written consent including,\nwithout limitation, in connection with any unauthorized modifications\nto any of its public licenses or any other arrangements,\nunderstandings, or agreements concerning use of licensed material. For\nthe avoidance of doubt, this paragraph does not form part of the\npublic licenses.\n\nCreative Commons may be contacted at creativecommons.org.\n"
  },
  {
    "path": "requirements.txt",
    "content": "boto==2.40.0\nclick==6.7\nconfigparser==3.5.0\ncryptography==43.0.1\nenum34==1.1.6\nFlask==2.3.2\nfuture==0.18.3\nhttplib2==0.19.0\nipaddress==1.0.16\nitsdangerous==0.24\nJinja2==3.1.4\njsonschema==2.5.1\nlockfile==0.12.2\nMarkupSafe==0.23\nndg-httpsclient==0.4.2\npsutil==5.6.6\npyasn1==0.1.9\npycurl==7.43.0\npyOpenSSL==17.5.0\npytz==2016.10\npyxdg==0.26\nrequests==2.32.0\nscour==0.32\nsix==1.10.0\nvirtualenv==15.1.0\nWerkzeug==3.0.3\n"
  },
  {
    "path": "static/general.js",
    "content": "$(document).ready(function(){\n    if ($('.memorizePanel').length != 0) {\n\n        $('.flipCard').click(function(){\n            if ($('.cardFront').is(\":visible\") == true) {\n                $('.cardFront').hide();\n                $('.cardBack').show();\n            } else {\n                $('.cardFront').show();\n                $('.cardBack').hide();\n            }\n        });\n    }\n\n    if ($('.cardForm').length != 0) {\n\n        $('.cardForm').submit(function(){\n\n            var frontTrim = $.trim($('#front').val());\n            $('#front').val(frontTrim);\n            var backTrim = $.trim($('#back').val());\n            $('#back').val(backTrim);\n\n            if (! $('#front').val() || ! $('#back').val()) {\n                return false;\n            }\n        });\n    }\n\n    if ($('.editPanel').length != 0) {\n\n        function checkit() {\n            var checkedVal = $('input[name=type]:checked').val();\n            var checkedId = $('input[name=type]:checked').attr(\"id\");\n            if (checkedVal === undefined) {\n                // hide the fields\n                $('.fieldFront').hide();\n                $('.fieldBack').hide();\n                $('.saveButton').hide();\n            } else {\n                $('.toggleButton').removeClass('toggleSelected');\n            \n                if(checkedId === undefined) {\n                    $(this).addClass('toggleSelected');\n                } else {\n                    $('label[for='+ checkedId +']').addClass('toggleSelected');\n                }\n\n                $('.fieldFront').show();\n                $('.fieldBack').show();\n                $('.saveButton').show();\n            }\n        }\n\n        $('.toggleButton').click(checkit);\n\n        checkit();\n    }\n\n    // to remove the short delay on click on touch devices\n    FastClick.attach(document.body);\n});\n"
  },
  {
    "path": "static/highlight-theme-github.css",
    "content": "/*\n\ngithub.com style (c) Vasily Polovnyov <vast@whiteants.net>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  color: #333;\n  background: #f8f8f8;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #998;\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-subst {\n  color: #333;\n  font-weight: bold;\n}\n\n.hljs-number,\n.hljs-literal,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag .hljs-attr {\n  color: #008080;\n}\n\n.hljs-string,\n.hljs-doctag {\n  color: #d14;\n}\n\n.hljs-title,\n.hljs-section,\n.hljs-selector-id {\n  color: #900;\n  font-weight: bold;\n}\n\n.hljs-subst {\n  font-weight: normal;\n}\n\n.hljs-type,\n.hljs-class .hljs-title {\n  color: #458;\n  font-weight: bold;\n}\n\n.hljs-tag,\n.hljs-name,\n.hljs-attribute {\n  color: #000080;\n  font-weight: normal;\n}\n\n.hljs-regexp,\n.hljs-link {\n  color: #009926;\n}\n\n.hljs-symbol,\n.hljs-bullet {\n  color: #990073;\n}\n\n.hljs-built_in,\n.hljs-builtin-name {\n  color: #0086b3;\n}\n\n.hljs-meta {\n  color: #999;\n  font-weight: bold;\n}\n\n.hljs-deletion {\n  background: #fdd;\n}\n\n.hljs-addition {\n  background: #dfd;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "static/highlight.pack.js",
    "content": "/*! highlight.js v9.9.0 | BSD3 License | git.io/hljslicense */\n!function(e){var n=\"object\"==typeof window&&window||\"object\"==typeof self&&self;\"undefined\"!=typeof exports?e(exports):n&&(n.hljs=e({}),\"function\"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/[&<>]/gm,function(e){return I[e]})}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function i(e){return k.test(e)}function a(e){var n,t,r,a,o=e.className+\" \";if(o+=e.parentNode?e.parentNode.className:\"\",t=B.exec(o))return R(t[1])?t[1]:\"no-highlight\";for(o=o.split(/\\s+/),n=0,r=o.length;r>n;n++)if(a=o[n],i(a)||R(a))return a}function o(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function u(e){var n=[];return function r(e,i){for(var a=e.firstChild;a;a=a.nextSibling)3===a.nodeType?i+=a.nodeValue.length:1===a.nodeType&&(n.push({event:\"start\",offset:i,node:a}),i=r(a,i),t(a).match(/br|hr|img|input/)||n.push({event:\"stop\",offset:i,node:a}));return i}(e,0),n}function c(e,r,i){function a(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset<r[0].offset?e:r:\"start\"===r[0].event?e:r:e.length?e:r}function o(e){function r(e){return\" \"+e.nodeName+'=\"'+n(e.value)+'\"'}l+=\"<\"+t(e)+w.map.call(e.attributes,r).join(\"\")+\">\"}function u(e){l+=\"</\"+t(e)+\">\"}function c(e){(\"start\"===e.event?o:u)(e.node)}for(var s=0,l=\"\",f=[];e.length||r.length;){var g=a();if(l+=n(i.substring(s,g[0].offset)),s=g[0].offset,g===e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=a();while(g===e&&g.length&&g[0].offset===s);f.reverse().forEach(o)}else\"start\"===g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return l+n(i.substr(s))}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),\"m\"+(e.cI?\"i\":\"\")+(r?\"g\":\"\"))}function r(i,a){if(!i.compiled){if(i.compiled=!0,i.k=i.k||i.bK,i.k){var u={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(\" \").forEach(function(e){var t=e.split(\"|\");u[t[0]]=[n,t[1]?Number(t[1]):1]})};\"string\"==typeof i.k?c(\"keyword\",i.k):E(i.k).forEach(function(e){c(e,i.k[e])}),i.k=u}i.lR=t(i.l||/\\w+/,!0),a&&(i.bK&&(i.b=\"\\\\b(\"+i.bK.split(\" \").join(\"|\")+\")\\\\b\"),i.b||(i.b=/\\B|\\b/),i.bR=t(i.b),i.e||i.eW||(i.e=/\\B|\\b/),i.e&&(i.eR=t(i.e)),i.tE=n(i.e)||\"\",i.eW&&a.tE&&(i.tE+=(i.e?\"|\":\"\")+a.tE)),i.i&&(i.iR=t(i.i)),null==i.r&&(i.r=1),i.c||(i.c=[]);var s=[];i.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push(\"self\"===e?i:e)}),i.c=s,i.c.forEach(function(e){r(e,i)}),i.starts&&r(i.starts,a);var l=i.c.map(function(e){return e.bK?\"\\\\.?(\"+e.b+\")\\\\.?\":e.b}).concat([i.tE,i.i]).map(n).filter(Boolean);i.t=l.length?t(l.join(\"|\"),!0):{exec:function(){return null}}}}r(e)}function l(e,t,i,a){function o(e,n){var t,i;for(t=0,i=n.c.length;i>t;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!i&&r(n.iR,e)}function g(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function h(e,n,t,r){var i=r?\"\":y.classPrefix,a='<span class=\"'+i,o=t?\"\":C;return a+=e+'\">',a+n+o}function p(){var e,t,r,i;if(!E.k)return n(B);for(i=\"\",t=0,E.lR.lastIndex=0,r=E.lR.exec(B);r;)i+=n(B.substring(t,r.index)),e=g(E,r),e?(M+=e[1],i+=h(e[0],n(r[0]))):i+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(B);return i+n(B.substr(t))}function d(){var e=\"string\"==typeof E.sL;if(e&&!x[E.sL])return n(B);var t=e?l(E.sL,B,!0,L[E.sL]):f(B,E.sL.length?E.sL:void 0);return E.r>0&&(M+=t.r),e&&(L[E.sL]=t.top),h(t.language,t.value,!1,!0)}function b(){k+=null!=E.sL?d():p(),B=\"\"}function v(e){k+=e.cN?h(e.cN,\"\",!0):\"\",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(B+=e,null==n)return b(),0;var t=o(n,E);if(t)return t.skip?B+=n:(t.eB&&(B+=n),b(),t.rB||t.eB||(B=n)),v(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var i=E;i.skip?B+=n:(i.rE||i.eE||(B+=n),b(),i.eE&&(B=n));do E.cN&&(k+=C),E.skip||(M+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&v(r.starts,\"\"),i.rE?0:n.length}if(c(n,E))throw new Error('Illegal lexeme \"'+n+'\" for mode \"'+(E.cN||\"<unnamed>\")+'\"');return B+=n,n.length||1}var N=R(e);if(!N)throw new Error('Unknown language: \"'+e+'\"');s(N);var w,E=a||N,L={},k=\"\";for(w=E;w!==N;w=w.parent)w.cN&&(k=h(w.cN,\"\",!0)+k);var B=\"\",M=0;try{for(var I,j,O=0;;){if(E.t.lastIndex=O,I=E.t.exec(t),!I)break;j=m(t.substring(O,I.index),I[0]),O=I.index+j}for(m(t.substr(O)),w=E;w.parent;w=w.parent)w.cN&&(k+=C);return{r:M,value:k,language:e,top:E}}catch(T){if(T.message&&-1!==T.message.indexOf(\"Illegal\"))return{r:0,value:n(t)};throw T}}function f(e,t){t=t||y.languages||E(x);var r={r:0,value:n(e)},i=r;return t.filter(R).forEach(function(n){var t=l(n,e,!1);t.language=n,t.r>i.r&&(i=t),t.r>r.r&&(i=r,r=t)}),i.language&&(r.second_best=i),r}function g(e){return y.tabReplace||y.useBR?e.replace(M,function(e,n){return y.useBR&&\"\\n\"===e?\"<br>\":y.tabReplace?n.replace(/\\t/g,y.tabReplace):void 0}):e}function h(e,n,t){var r=n?L[n]:t,i=[e.trim()];return e.match(/\\bhljs\\b/)||i.push(\"hljs\"),-1===e.indexOf(r)&&i.push(r),i.join(\" \").trim()}function p(e){var n,t,r,o,s,p=a(e);i(p)||(y.useBR?(n=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\"),n.innerHTML=e.innerHTML.replace(/\\n/g,\"\").replace(/<br[ \\/]*>/g,\"\\n\")):n=e,s=n.textContent,r=p?l(p,s,!0):f(s),t=u(n),t.length&&(o=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\"),o.innerHTML=r.value,r.value=c(t,u(o),s)),r.value=g(r.value),e.innerHTML=r.value,e.className=h(e.className,p,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function d(e){y=o(y,e)}function b(){if(!b.called){b.called=!0;var e=document.querySelectorAll(\"pre code\");w.forEach.call(e,p)}}function v(){addEventListener(\"DOMContentLoaded\",b,!1),addEventListener(\"load\",b,!1)}function m(n,t){var r=x[n]=t(e);r.aliases&&r.aliases.forEach(function(e){L[e]=n})}function N(){return E(x)}function R(e){return e=(e||\"\").toLowerCase(),x[e]||x[L[e]]}var w=[],E=Object.keys,x={},L={},k=/^(no-?highlight|plain|text)$/i,B=/\\blang(?:uage)?-([\\w-]+)\\b/i,M=/((^(<[^>]+>|\\t|)+|(?:\\n)))/gm,C=\"</span>\",y={classPrefix:\"hljs-\",tabReplace:null,useBR:!1,languages:void 0},I={\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\"};return e.highlight=l,e.highlightAuto=f,e.fixMarkup=g,e.highlightBlock=p,e.configure=d,e.initHighlighting=b,e.initHighlightingOnLoad=v,e.registerLanguage=m,e.listLanguages=N,e.getLanguage=R,e.inherit=o,e.IR=\"[a-zA-Z]\\\\w*\",e.UIR=\"[a-zA-Z_]\\\\w*\",e.NR=\"\\\\b\\\\d+(\\\\.\\\\d+)?\",e.CNR=\"(-?)(\\\\b0[xX][a-fA-F0-9]+|(\\\\b\\\\d+(\\\\.\\\\d*)?|\\\\.\\\\d+)([eE][-+]?\\\\d+)?)\",e.BNR=\"\\\\b(0b[01]+)\",e.RSR=\"!|!=|!==|%|%=|&|&&|&=|\\\\*|\\\\*=|\\\\+|\\\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\\\?|\\\\[|\\\\{|\\\\(|\\\\^|\\\\^=|\\\\||\\\\|=|\\\\|\\\\||~\",e.BE={b:\"\\\\\\\\[\\\\s\\\\S]\",r:0},e.ASM={cN:\"string\",b:\"'\",e:\"'\",i:\"\\\\n\",c:[e.BE]},e.QSM={cN:\"string\",b:'\"',e:'\"',i:\"\\\\n\",c:[e.BE]},e.PWM={b:/\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|like)\\b/},e.C=function(n,t,r){var i=e.inherit({cN:\"comment\",b:n,e:t,c:[]},r||{});return i.c.push(e.PWM),i.c.push({cN:\"doctag\",b:\"(?:TODO|FIXME|NOTE|BUG|XXX):\",r:0}),i},e.CLCM=e.C(\"//\",\"$\"),e.CBCM=e.C(\"/\\\\*\",\"\\\\*/\"),e.HCM=e.C(\"#\",\"$\"),e.NM={cN:\"number\",b:e.NR,r:0},e.CNM={cN:\"number\",b:e.CNR,r:0},e.BNM={cN:\"number\",b:e.BNR,r:0},e.CSSNM={cN:\"number\",b:e.NR+\"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\",r:0},e.RM={cN:\"regexp\",b:/\\//,e:/\\/[gimuy]*/,i:/\\n/,c:[e.BE,{b:/\\[/,e:/\\]/,r:0,c:[e.BE]}]},e.TM={cN:\"title\",b:e.IR,r:0},e.UTM={cN:\"title\",b:e.UIR,r:0},e.METHOD_GUARD={b:\"\\\\.\\\\s*\"+e.UIR,r:0},e});hljs.registerLanguage(\"java\",function(e){var a=\"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*\",t=a+\"(<\"+a+\"(\\\\s*,\\\\s*\"+a+\")*>)?\",r=\"false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do\",s=\"\\\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\\\d]+[\\\\d_]+[\\\\d]+|[\\\\d]+)(\\\\.([\\\\d]+[\\\\d_]+[\\\\d]+|[\\\\d]+))?|\\\\.([\\\\d]+[\\\\d_]+[\\\\d]+|[\\\\d]+))([eE][-+]?\\\\d+)?)[lLfF]?\",c={cN:\"number\",b:s,r:0};return{aliases:[\"jsp\"],k:r,i:/<\\/|#/,c:[e.C(\"/\\\\*\\\\*\",\"\\\\*/\",{r:0,c:[{b:/\\w+@/,r:0},{cN:\"doctag\",b:\"@[A-Za-z]+\"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:\"class\",bK:\"class interface\",e:/[{;=]/,eE:!0,k:\"class interface\",i:/[:\"\\[\\]]/,c:[{bK:\"extends implements\"},e.UTM]},{bK:\"new throw return else\",r:0},{cN:\"function\",b:\"(\"+t+\"\\\\s+)+\"+e.UIR+\"\\\\s*\\\\(\",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.UIR+\"\\\\s*\\\\(\",rB:!0,r:0,c:[e.UTM]},{cN:\"params\",b:/\\(/,e:/\\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},c,{cN:\"meta\",b:\"@[A-Za-z]+\"}]}});hljs.registerLanguage(\"cpp\",function(t){var e={cN:\"keyword\",b:\"\\\\b[a-z\\\\d_]*_t\\\\b\"},r={cN:\"string\",v:[{b:'(u8?|U)?L?\"',e:'\"',i:\"\\\\n\",c:[t.BE]},{b:'(u8?|U)?R\"',e:'\"',c:[t.BE]},{b:\"'\\\\\\\\?.\",e:\"'\",i:\".\"}]},s={cN:\"number\",v:[{b:\"\\\\b(0b[01']+)\"},{b:\"\\\\b([\\\\d']+(\\\\.[\\\\d']*)?|\\\\.[\\\\d']+)(u|U|l|L|ul|UL|f|F|b|B)\"},{b:\"(-?)(\\\\b0[xX][a-fA-F0-9']+|(\\\\b[\\\\d']+(\\\\.[\\\\d']*)?|\\\\.[\\\\d']+)([eE][-+]?[\\\\d']+)?)\"}],r:0},i={cN:\"meta\",b:/#\\s*[a-z]+\\b/,e:/$/,k:{\"meta-keyword\":\"if else elif endif define undef warning error line pragma ifdef ifndef include\"},c:[{b:/\\\\\\n/,r:0},t.inherit(r,{cN:\"meta-string\"}),{cN:\"meta-string\",b:\"<\",e:\">\",i:\"\\\\n\"},t.CLCM,t.CBCM]},a=t.IR+\"\\\\s*\\\\(\",c={keyword:\"int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return\",built_in:\"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr\",literal:\"true false nullptr NULL\"},n=[e,t.CLCM,t.CBCM,s,r];return{aliases:[\"c\",\"cc\",\"h\",\"c++\",\"h++\",\"hpp\"],k:c,i:\"</\",c:n.concat([i,{b:\"\\\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\\\s*<\",e:\">\",k:c,c:[\"self\",e]},{b:t.IR+\"::\",k:c},{v:[{b:/=/,e:/;/},{b:/\\(/,e:/\\)/},{bK:\"new throw return else\",e:/;/}],k:c,c:n.concat([{b:/\\(/,e:/\\)/,k:c,c:n.concat([\"self\"]),r:0}]),r:0},{cN:\"function\",b:\"(\"+t.IR+\"[\\\\*&\\\\s]+)+\"+a,rB:!0,e:/[{;=]/,eE:!0,k:c,i:/[^\\w\\s\\*&]/,c:[{b:a,rB:!0,c:[t.TM],r:0},{cN:\"params\",b:/\\(/,e:/\\)/,k:c,r:0,c:[t.CLCM,t.CBCM,r,s,e]},t.CLCM,t.CBCM,i]}]),exports:{preprocessor:i,strings:r,k:c}}});hljs.registerLanguage(\"python\",function(e){var r={cN:\"meta\",b:/^(>>>|\\.\\.\\.) /},b={cN:\"string\",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[r],r:10},{b:/(u|b)?r?\"\"\"/,e:/\"\"\"/,c:[r],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)\"/,e:/\"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)\"/,e:/\"/},e.ASM,e.QSM]},a={cN:\"number\",r:0,v:[{b:e.BNR+\"[lLjJ]?\"},{b:\"\\\\b(0o[0-7]+)[lLjJ]?\"},{b:e.CNR+\"[lLjJ]?\"}]},l={cN:\"params\",b:/\\(/,e:/\\)/,c:[\"self\",r,a,b]};return{aliases:[\"py\",\"gyp\"],k:{keyword:\"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10 None True False\",built_in:\"Ellipsis NotImplemented\"},i:/(<\\/|->|\\?)|=>/,c:[r,a,b,e.HCM,{v:[{cN:\"function\",bK:\"def\"},{cN:\"class\",bK:\"class\"}],e:/:/,i:/[${=;\\n,]/,c:[e.UTM,l,{b:/->/,eW:!0,k:\"None\"}]},{cN:\"meta\",b:/^[\\t ]*@/,e:/$/},{b:/\\b(print|exec)\\(/}]}});hljs.registerLanguage(\"cs\",function(e){var i={keyword:\"abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while nameof add alias ascending async await by descending dynamic equals from get global group into join let on orderby partial remove select set value var where yield\",literal:\"null false true\"},r={cN:\"string\",b:'@\"',e:'\"',c:[{b:'\"\"'}]},t=e.inherit(r,{i:/\\n/}),a={cN:\"subst\",b:\"{\",e:\"}\",k:i},n=e.inherit(a,{i:/\\n/}),c={cN:\"string\",b:/\\$\"/,e:'\"',i:/\\n/,c:[{b:\"{{\"},{b:\"}}\"},e.BE,n]},s={cN:\"string\",b:/\\$@\"/,e:'\"',c:[{b:\"{{\"},{b:\"}}\"},{b:'\"\"'},a]},o=e.inherit(s,{i:/\\n/,c:[{b:\"{{\"},{b:\"}}\"},{b:'\"\"'},n]});a.c=[s,c,r,e.ASM,e.QSM,e.CNM,e.CBCM],n.c=[o,c,t,e.ASM,e.QSM,e.CNM,e.inherit(e.CBCM,{i:/\\n/})];var l={v:[s,c,r,e.ASM,e.QSM]},b=e.IR+\"(<\"+e.IR+\"(\\\\s*,\\\\s*\"+e.IR+\")*>)?(\\\\[\\\\])?\";return{aliases:[\"csharp\"],k:i,i:/::/,c:[e.C(\"///\",\"$\",{rB:!0,c:[{cN:\"doctag\",v:[{b:\"///\",r:0},{b:\"<!--|-->\"},{b:\"</?\",e:\">\"}]}]}),e.CLCM,e.CBCM,{cN:\"meta\",b:\"#\",e:\"$\",k:{\"meta-keyword\":\"if else elif endif define undef warning error line region endregion pragma checksum\"}},l,e.CNM,{bK:\"class interface\",e:/[{;=]/,i:/[^\\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:\"namespace\",e:/[{;=]/,i:/[^\\s:]/,c:[e.inherit(e.TM,{b:\"[a-zA-Z](\\\\.?\\\\w)*\"}),e.CLCM,e.CBCM]},{bK:\"new return throw await\",r:0},{cN:\"function\",b:\"(\"+b+\"\\\\s+)+\"+e.IR+\"\\\\s*\\\\(\",rB:!0,e:/[{;=]/,eE:!0,k:i,c:[{b:e.IR+\"\\\\s*\\\\(\",rB:!0,c:[e.TM],r:0},{cN:\"params\",b:/\\(/,e:/\\)/,eB:!0,eE:!0,k:i,r:0,c:[l,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage(\"javascript\",function(e){var r=\"[A-Za-z$_][0-9A-Za-z$_]*\",t={keyword:\"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as\",literal:\"true false null undefined NaN Infinity\",built_in:\"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise\"},a={cN:\"number\",v:[{b:\"\\\\b(0[bB][01]+)\"},{b:\"\\\\b(0[oO][0-7]+)\"},{b:e.CNR}],r:0},n={cN:\"subst\",b:\"\\\\$\\\\{\",e:\"\\\\}\",k:t,c:[]},c={cN:\"string\",b:\"`\",e:\"`\",c:[e.BE,n]};n.c=[e.ASM,e.QSM,c,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:[\"js\",\"jsx\"],k:t,c:[{cN:\"meta\",r:10,b:/^\\s*['\"]use (strict|asm)['\"]/},{cN:\"meta\",b:/^#!/,e:/$/},e.ASM,e.QSM,c,e.CLCM,e.CBCM,a,{b:/[{,]\\s*/,r:0,c:[{b:r+\"\\\\s*:\",rB:!0,r:0,c:[{cN:\"attr\",b:r,r:0}]}]},{b:\"(\"+e.RSR+\"|\\\\b(case|return|throw)\\\\b)\\\\s*\",k:\"return throw case\",c:[e.CLCM,e.CBCM,e.RM,{cN:\"function\",b:\"(\\\\(.*?\\\\)|\"+r+\")\\\\s*=>\",rB:!0,e:\"\\\\s*=>\",c:[{cN:\"params\",v:[{b:r},{b:/\\(\\s*\\)/},{b:/\\(/,e:/\\)/,eB:!0,eE:!0,k:t,c:s}]}]},{b:/</,e:/(\\/\\w+|\\w+\\/)>/,sL:\"xml\",c:[{b:/<\\w+\\s*\\/>/,skip:!0},{b:/<\\w+/,e:/(\\/\\w+|\\w+\\/)>/,skip:!0,c:[{b:/<\\w+\\s*\\/>/,skip:!0},\"self\"]}]}],r:0},{cN:\"function\",bK:\"function\",e:/\\{/,eE:!0,c:[e.inherit(e.TM,{b:r}),{cN:\"params\",b:/\\(/,e:/\\)/,eB:!0,eE:!0,c:s}],i:/\\[|%/},{b:/\\$[(.]/},e.METHOD_GUARD,{cN:\"class\",bK:\"class\",e:/[{;=]/,eE:!0,i:/[:\"\\[\\]]/,c:[{bK:\"extends\"},e.UTM]},{bK:\"constructor\",e:/\\{/,eE:!0}],i:/#(?!!)/}});"
  },
  {
    "path": "static/style.css",
    "content": ".toggleSelected {\n    background-color: #62b06b;\n    color: #ffffff;\n}\n\ntextarea {\n    font-family: monospace;\n}\n\n.cardContent .tagContent h4 {\n    margin-top: 0;\n}\n\n.alignContainer {\n    display: table;\n    width: 100%;\n}\n\n.alignMiddle {\n    height: 20em;\n    display: table-cell;\n    vertical-align: middle;\n}\n\n.cardBack {\n    display: none;\n}\n\n.largerText {\n    font-size: 2em;\n}\n\n\n/* disables collapsing header menu */\n\n.navbar-collapse.collapse {\n  display: block!important;\n}\n\n.navbar-nav>li, .navbar-nav {\n  float: left !important;\n}\n\n.navbar-nav.navbar-right:last-child {\n  margin-right: 0 !important;\n}\n\n.navbar-right {\n  float: right!important;\n}"
  },
  {
    "path": "templates/cards.html",
    "content": "{% extends \"layout.html\" %}\n{% block body %}\n\n    <div class=\"well editPanel\">\n        <h2>Add a Card</h2>\n        <form action=\"{{ url_for('add_card') }}\" method=\"post\" class=\"cardForm\">\n            <div class=\"form-group\">\n                {% for tag in tags %}\n                <label for={{tag.tagName}} class=\"toggleButton btn btn-default btn-lg\">{{tag.tagName}} &nbsp;\n                    <input type=\"radio\" name=\"type\" value={{tag.id}} id={{tag.tagName}}>\n                </label>\n                {% endfor %}\n            </div>\n            <div class=\"form-group fieldFront\">\n                <label for=\"front\">Front of Card</label>\n                <input type=\"text\" name=\"front\" id=\"front\" class=\"form-control\">\n            </div>\n            <div class=\"form-group fieldBack\">\n                <label for=\"back\">Back of Card</label>\n                <textarea name=\"back\"\n                          class=\"form-control\"\n                          id=\"back\"\n                          placeholder=\"back of card\"\n                          rows=\"12\"></textarea>\n            </div>\n            <div class=\"form-group\">\n                <button type=\"submit\" class=\"saveButton btn btn-lg btn-primary\">Save</button>\n            </div>\n        </form>\n    </div>\n\n    <div class=\"page-header\">\n        <h2>{{ cards|length }} Card{{ '' if (cards|length == 1) else 's' }}</h2>\n    </div>\n\n{% endblock %}\n"
  },
  {
    "path": "templates/createDb.html",
    "content": "{% extends \"layout.html\" %}\n{% block body %}\n\n<div class=\"well editPanelTag\">\n    <h2>Init database</h2>\n    <form action=\"{{ url_for('init') }}\" method=\"post\" class=\"dbForm\">\n        <div class=\"form-group fieldDbName\">\n            <label for=\"dbName\">Database name</label>\n            <input type=\"text\" name=\"dbName\" id=\"dbName\" class=\"form-control\">\n        </div>\n        <div class=\"form-group\">\n            <button type=\"submit\" class=\"saveButton btn btn-lg btn-primary\">Create</button>\n        </div>\n    </form>\n</div>\n\n{% endblock %}\n"
  },
  {
    "path": "templates/edit.html",
    "content": "{% extends \"layout.html\" %}\n{% block body %}\n    <div class=\"well editPanel\">\n        <h2>Edit Card #{{ card.id }}</h2>\n        <form action=\"{{ url_for('edit_card') }}\" method=\"post\" class=\"cardForm\">\n\n            <div class=\"form-group\">\n                {% for tag in tags %}\n                    <label for={{tag.tagName}} class=\"toggleButton btn btn-default btn-lg\">{{tag.tagName}} &nbsp;\n                        <input type=\"radio\" name=\"type\" value={{tag.id}}\n                            id={{tag.tagName}} {{ \"checked\" if (card.type == tag.id) else \"\" }} />\n                    </label>\n                {% endfor %}\n\n                <!-- <label for=\"general\" class=\"btn btn-default btn-lg\">General &nbsp;\n                    <input type=\"radio\" name=\"type\" value=\"1\"\n                           id=\"general\" {{ \"checked\" if (card.type == 1) else \"\" }} />\n                </label>\n                <label for=\"code\" class=\"btn btn-default btn-lg\">Code &nbsp;\n                    <input type=\"radio\" name=\"type\" value=\"2\" id=\"code\" {{ \"checked\" if (card.type == 2) else \"\" }} />\n                </label> -->\n            </div>\n            <div class=\"form-group\">\n                <label for=\"front\">Front of Card</label>\n                <input type=\"text\" name=\"front\" id=\"front\" class=\"form-control\" value=\"{{ card.front|e }}\">\n            </div>\n            <div class=\"form-group\">\n                <label for=\"back\">Back of Card</label>\n                <textarea name=\"back\"\n                          class=\"form-control\"\n                          id=\"back\"\n                          placeholder=\"back of card\"\n                          rows=\"12\">{{ card.back|e }}</textarea>\n            </div>\n            <div class=\"row\">\n                <div class=\"col-xs-6\">\n                    <div class=\"checkbox\">\n                        <label>\n                            <input type=\"checkbox\" name=\"known\"\n                               value=\"1\" {{ \"checked\" if (card.known == 1) else \"\" }} /> Known\n                        </label>\n                    </div>\n                </div>\n                <div class=\"col-xs-6 text-right\">\n                    <a href=\"{{ url_for('delete', card_id=card.id) }}\" class=\"btn btn-danger btn-xs\">\n                        <i class=\"fa fa-trash\"></i>\n                        Remove\n                    </a>\n                </div>\n            </div>\n\n            <hr />\n            <div class=\"form-group\">\n                <input type=\"hidden\" name=\"card_id\" value=\"{{ card.id|e }}\" />\n                <button type=\"submit\" class=\"saveButton btn btn-lg btn-primary\">Save</button>\n            </div>\n        </form>\n    </div>\n{% endblock %}\n"
  },
  {
    "path": "templates/editTag.html",
    "content": "{% extends \"layout.html\" %}\n{% block body %}\n    <div class=\"well\">\n        <h2>Edit Tag #{{ tag.id }}</h2>\n        <form action=\"{{ url_for('update_tag') }}\" method=\"post\" class=\"tagForm\">\n            <div class=\"form-group\">\n                <label for=\"tagName\">Tag name</label>\n                <input type=\"text\" name=\"tagName\" id=\"tagName\" class=\"form-control\" value=\"{{ tag.tagName|e }}\">\n            </div>\n\n            <hr />\n            <div class=\"form-group\">\n                <input type=\"hidden\" name=\"tag_id\" value=\"{{ tag.id|e }}\" />\n                <button type=\"submit\" class=\"saveButton btn btn-lg btn-primary\">Save</button>\n            </div>\n        </form>\n    </div>\n{% endblock %}\n"
  },
  {
    "path": "templates/layout.html",
    "content": "<!doctype html>\n<html>\n<head>\n    <title>CS Flash Cards</title>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n    <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css\"\n          integrity=\"sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7\" crossorigin=\"anonymous\">\n    <link rel=stylesheet type=text/css href=\"{{ url_for('static', filename='style.css') }}\"/>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"{{ url_for('static', filename='highlight-theme-github.css') }}\" />\n    <script src=\"{{ url_for('static', filename='highlight.pack.js') }}\"></script>\n</head>\n<body>\n    <div class=\"container\">\n        <div class=\"row\">\n            <div class=\"col-xs-12\">\n\n                <br/>\n                <nav class=\"navbar navbar-default\">\n                    <div class=\"navbar-header\">\n                        <a class=\"navbar-brand\" href=\"{{ url_for('index') }}\">CS Flash Cards</a>\n\n                        <ul class=\"nav navbar-nav navbar-right\">\n                            {% if not session.logged_in %}\n                                <li><a href=\"{{ url_for('login') }}\">log in</a></li>\n                            {% else %}\n                                <li><a href=\"{{ url_for('cards') }}\">cards</a></li>\n                                <li><a href=\"{{ url_for('tags') }}\">tags</a></li>\n                                <li><a href=\"{{ url_for('show') }}\">show</a></li>\n                                <li><a href=\"{{ url_for('list_db') }}\">list database</a></li>\n                                <li><a href=\"{{ url_for('create_db') }}\">create database</a></li>\n                                <li><a href=\"{{ url_for('memorize', card_type='1') }}\">memorize</a></li>\n                                <li><a href=\"{{ url_for('memorize_known', card_type='1') }}\">memorize known items</a></li>\n                                <li>&nbsp;&nbsp;&nbsp;&nbsp;</li>\n                                <li><a href=\"{{ url_for('logout') }}\">log out</a></li>\n                            {% endif %}\n                        </ul>\n                    </div>\n                </nav>\n\n                {% for message in get_flashed_messages() %}\n                    <div class=\"alert alert-success\" role=\"alert\">{{ message }}</div>\n                {% endfor %}\n                {% block body %}{% endblock %}\n            </div>\n        </div>\n    </div>\n    <script src=\"https://code.jquery.com/jquery-2.2.4.min.js\"\n            integrity=\"sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=\" crossorigin=\"anonymous\"></script>\n    <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js\"></script>\n    <script src=\"https://use.fontawesome.com/8cea844162.js\"></script>\n    <script src=\"{{ url_for('static', filename='fastclick.min.js') }}\"></script>\n    <script src=\"{{ url_for('static', filename='general.js') }}\"></script>\n</body>\n</html>\n"
  },
  {
    "path": "templates/listDb.html",
    "content": "{% extends \"layout.html\" %}\n{% block body %}\n\n<table class=\"table table-bordered\">\n    {% for db in dbs %}\n        <tr>\n            <td>\n                <a href=\"{{ url_for('load_db', name=db) }}\" class=\"btn btn-lg btn-primary\">Load</a>\n            </td>\n            <td class=\"dbContent\">\n                <h4>\n                    {{ db }}\n                </h4>\n            </td>\n        </tr>\n    {% else %}\n        <tr>\n            <td>\n                <em>No dbs to show.</em>\n            </td>\n        </tr>\n    {% endfor %}\n</table>\n\n{% endblock %}"
  },
  {
    "path": "templates/login.html",
    "content": "{% extends \"layout.html\" %}\n{% block body %}\n    <h2>Login</h2>\n    {% if error %}\n        <div class=\"alert alert-danger\" role=\"alert\">{{ error }}</div>\n    {% endif %}\n\n    <div class=\"well\">\n        <form action=\"{{ url_for('login') }}\" method=post>\n            <div class=\"form-group\">\n                <label for=\"username\">Username:</label>\n                <input type=\"text\" name=\"username\" class=\"form-control\">\n            </div>\n            <div class=\"form-group\">\n                <label for=\"password\">Password</label>\n                <input type=\"password\" name=\"password\" class=\"form-control\">\n            </div>\n            <div class=\"form-group\">\n                <button type=\"submit\" class=\"btn btn-lg btn-primary\">Log in</button>\n            </div>\n        </form>\n    </div>\n{% endblock %}"
  },
  {
    "path": "templates/memorize.html",
    "content": "{% extends \"layout.html\" %}\n{% block body %}\n\n    <div class=\"row\">\n        <div class=\"col-xs-12 text-center\">\n            <div class=\"btn-group btn-group-lg\" role=\"group\" aria-label=\"card type\">\n                {% for tag in tags %}\n                    <a href=\"{{ url_for('memorize', card_type=tag.id) }}\" class=\"btn btn-{{ \"primary\" if card_type == tag.id else \"default\" }}\">{{tag.tagName}}</a>\n                {% endfor %}\n            </div>\n        </div>\n    </div>\n\n    <hr/>\n\n    <div class=\"row memorizePanel\">\n        <!--\n        <div class=\"col-xs-2\">\n            <div class=\"alignContainer\">\n                <div class=\"alignMiddle text-right\">\n                    <br/>\n                    <br/>\n                    <a href=\"wewetw\"><i class=\"fa fa-chevron-left fa-5x\"></i></a>\n                </div>\n            </div>\n        </div>\n        -->\n        <div class=\"col-xs-8 col-xs-offset-2\">\n            <div class=\"panel panel-default cardFront\">\n                <div class=\"panel-body\">\n                    <div class=\"alignContainer\">\n                        <div class=\"alignMiddle frontText\">\n                            <h3 class=\"text-center\">{{ card.front }}</h3>\n                        </div>\n                    </div>\n                </div>\n            </div>\n            <div class=\"panel panel-primary cardBack\">\n                <div class=\"panel-body\">\n                    <div class=\"alignContainer\">\n                        <div class=\"alignMiddle frontText\">\n                            {% if card.type == 1 %}\n                                {% if short_answer %}\n                                    <div class=\"text-center largerText\">\n                                {% endif %}\n                                    {{ card.back|replace(\"\\n\", \"<br />\")|safe }}\n                                {% if short_answer %}\n                                    </div>\n                                {% endif %}\n                            {% else %}\n                                <pre><code>{{ card.back|escape }}</code></pre>\n                            {% endif %}\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <!--\n        <div class=\"col-xs-2\">\n            <div class=\"alignContainer\">\n                <div class=\"alignMiddle text-left\">\n                    <br/>\n                    <br/>\n                    <a href=\"ergergerge\"><i class=\"fa fa-chevron-right fa-5x\"></i></a>\n                </div>\n            </div>\n        </div>\n        -->\n    </div>\n\n    <div class=\"row\">\n        <div class=\"col-xs-12 text-center\">\n            <a href=\"javascript:\" class=\"btn btn-primary btn-lg flipCard\">\n                <i class=\"fa fa-exchange\"></i>\n                Flip Card\n            </a>\n            &nbsp;\n            &nbsp;\n            <a href=\"{{ url_for('mark_known', card_id=card.id, card_type=card_type) }}\" class=\"btn btn-success btn-lg\">\n                <i class=\"fa fa-check\"></i>\n                I Know It\n            </a>\n            &nbsp;\n            &nbsp;\n            <a href=\"{{ url_for('memorize', card_type=card_type) }}\" class=\"btn btn-primary btn-lg\">\n                Next Card\n                <i class=\"fa fa-arrow-right\"></i>\n            </a>\n        </div>\n    </div>\n    <div class=\"row\">\n        <div class=\"col-xs-12 text-center\">\n            <br />\n            <br />\n            <br />\n            <a href=\"{{ url_for('bookmark', card_type=3, card_id=card.id) }}\" class=\"btn btn-default btn-sm\">\n                <i class=\"fa fa-bookmark\"></i>\n                bookmark this card (#{{ card.id }})\n            </a>\n\n        </div>\n    </div>\n\n{% endblock %}\n"
  },
  {
    "path": "templates/memorize_known.html",
    "content": "{% extends \"layout.html\" %}\n{% block body %}\n\n    <div class=\"row\">\n        <div class=\"col-xs-12 text-center\">\n            <div class=\"btn-group btn-group-lg\" role=\"group\" aria-label=\"card type\">\n                {% for tag in tags %}\n                    <a href=\"{{ url_for('memorize_known', card_type=tag.id) }}\" class=\"btn btn-{{ \"primary\" if card_type == tag.id else \"default\" }}\">{{tag.tagName}}</a>\n                {% endfor %}\n            </div>\n        </div>\n    </div>\n\n    <hr/>\n\n    <div class=\"row memorizePanel\">\n        <div class=\"col-xs-8 col-xs-offset-2\">\n            <div class=\"panel panel-default cardFront\">\n                <div class=\"panel-body\">\n                    <div class=\"alignContainer\">\n                        <div class=\"alignMiddle frontText\">\n                            <h3 class=\"text-center\">{{ card.front }}</h3>\n                        </div>\n                    </div>\n                </div>\n            </div>\n            <div class=\"panel panel-primary cardBack\">\n                <div class=\"panel-body\">\n                    <div class=\"alignContainer\">\n                        <div class=\"alignMiddle frontText\">\n                            {% if card.type == 1 %}\n                                {% if short_answer %}\n                                    <div class=\"text-center largerText\">\n                                {% endif %}\n                                    {{ card.back|replace(\"\\n\", \"<br />\")|safe }}\n                                {% if short_answer %}\n                                    </div>\n                                {% endif %}\n                            {% else %}\n                                <pre><code>{{ card.back|escape }}</code></pre>\n                            {% endif %}\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n\n    <div class=\"row\">\n        <div class=\"col-xs-12 text-center\">\n            <a href=\"javascript:\" class=\"btn btn-primary btn-lg flipCard\">\n                <i class=\"fa fa-exchange\"></i>\n                Flip Card\n            </a>\n            &nbsp;\n            &nbsp;\n            <a href=\"{{ url_for('mark_unknown', card_id=card.id, card_type=card_type) }}\" class=\"btn btn-success btn-lg\">\n                <i class=\"fa fa-check\"></i>\n                I Unknow It\n            </a>\n            &nbsp;\n            &nbsp;\n            <a href=\"{{ url_for('memorize_known', card_type=card_type) }}\" class=\"btn btn-primary btn-lg\">\n                Next Card\n                <i class=\"fa fa-arrow-right\"></i>\n            </a>\n        </div>\n    </div>\n    <div class=\"row\">\n        <div class=\"col-xs-12 text-center\">\n            <br />\n            <br />\n            <br />\n            <a href=\"{{ url_for('bookmark', card_type=3, card_id=card.id) }}\" class=\"btn btn-default btn-sm\">\n                <i class=\"fa fa-bookmark\"></i>\n                bookmark this card (#{{ card.id }})\n            </a>\n\n        </div>\n    </div>\n\n{% endblock %}\n"
  },
  {
    "path": "templates/show.html",
    "content": "{% extends \"layout.html\" %}\n{% block body %}\n\n<div class=\"page-header\">\n    <h2>{{ cards|length }} Card{{ '' if (cards|length == 1) else 's' }}</h2>\n</div>\n<div class=\"btn-group btn-group-md\" role=\"group\" aria-label=\"filters\">\n    <a href=\"{{ url_for('filter_cards', filter_name=\"all\") }}\" class=\"btn btn-{{ \"primary\" if filter_name == \"all\" else \"default\" }}\">all</a>\n    {% for tag in tags %}\n        <a href=\"{{ url_for('filter_cards', filter_name=tag.id) }}\" class=\"btn btn-{{ \"primary\" if filter_name == tag.id else \"default\" }}\">{{tag.tagName}}</a>\n    {% endfor %}\n    <a href=\"{{ url_for('filter_cards', filter_name=\"known\") }}\" class=\"btn btn-{{ \"primary\" if filter_name == \"known\" else \"default\" }}\">known</a>\n    <a href=\"{{ url_for('filter_cards', filter_name=\"unknown\") }}\" class=\"btn btn-{{ \"primary\" if filter_name == \"unknown\" else \"default\" }}\">unknown</a>\n</div>\n\n<br />\n<br />\n\n<table class=\"table table-bordered\">\n    {% for card in cards %}\n        <tr>\n            <td>\n                <a href=\"{{ url_for('edit', card_id=card.id) }}\" class=\"btn btn-xs btn-primary\"><i class=\"fa fa-pencil\" aria-hidden=\"true\"></i></a>\n            </td>\n            <td class=\"cardContent\">\n                <h4>\n                    {{ card.front }}\n                </h4>\n                {% if card.type == 1 %}\n                    {{ card.back|replace(\"\\n\", \"<br />\")|safe }}\n                {% else %}\n                    <pre><code>{{ card.back|escape }}</code></pre>\n                {% endif %}\n            </td>\n        </tr>\n    {% else %}\n        <tr>\n            <td>\n                <em>No cards to show.</em>\n            </td>\n        </tr>\n    {% endfor %}\n</table>\n\n{% endblock %}\n"
  },
  {
    "path": "templates/tags.html",
    "content": "{% extends \"layout.html\" %}\n{% block body %}\n\n    <div class=\"well editPanelTag\">\n        <h2>Add a Tag</h2>\n        <form action=\"{{ url_for('add_tag') }}\" method=\"post\" class=\"tagForm\">\n            <div class=\"form-group fieldTagName\">\n                <label for=\"tagName\">Tag name</label>\n                <input type=\"text\" name=\"tagName\" id=\"tagName\" class=\"form-control\">\n            </div>\n            <div class=\"form-group\">\n                <button type=\"submit\" class=\"saveButton btn btn-lg btn-primary\">Save</button>\n            </div>\n        </form>\n    </div>\n\n    <div class=\"page-header\">\n        <h2>{{ tags|length }} Tag{{ '' if (tags|length == 1) else 's' }}</h2>\n    </div>\n    <br />\n    <br />\n\n    <table class=\"table table-bordered\">\n        {% for tag in tags %}\n            <tr>\n                <td>\n                    <a href=\"{{ url_for('edit_tag', tag_id=tag.id) }}\" class=\"btn btn-xs btn-primary\"><i class=\"fa fa-pencil\" aria-hidden=\"true\"></i></a>\n                </td>\n                <td class=\"tagContent\">\n                    <h4>\n                        {{ tag.tagName }}\n                    </h4>\n                </td>\n            </tr>\n        {% else %}\n            <tr>\n                <td>\n                    <em>No tags to show.</em>\n                </td>\n            </tr>\n        {% endfor %}\n    </table>\n\n{% endblock %}\n"
  },
  {
    "path": "wsgi.py",
    "content": "from flash_cards import app\n\nif __name__ == \"__main__\":\n    app.run()\n\n"
  }
]