This demonstrates one method for creating JavaScript based Anki cards.
Tested on
- [Anki for desktop computers][anki-desktop] version 2.1.13
- [AnkiMobile][anki-mobile] (iOS) version 2.0.48
| CREATE OR REPLACE FUNCTION array_distinct(anyarray) RETURNS anyarray AS $$ | |
| SELECT coalesce(array_agg(x.value ORDER BY x.pos), '{}') | |
| FROM ( | |
| SELECT DISTINCT ON (item.value) item.value, item.pos | |
| FROM unnest($1) WITH ORDINALITY item(value, pos) | |
| ) x | |
| $$ LANGUAGE SQL | |
| CREATE OR REPLACE FUNCTION array_set(anyarray) RETURNS anyarray AS $$ | |
| SELECT coalesce(array_agg(x.v), '{}') |
| import collections.abc | |
| import typing as typ | |
| K = typing.TypeVar("K") | |
| V = typing.TypeVar("V") | |
| class FrozenMap(typing.Generic[K, V], collections.abc.Mapping[K, V]): | |
| __slots__ = ("_dict", "_hash") |
| /* | |
| Copyright (c) 2012 by Marcel Klehr <[email protected]> | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
| #!/usr/bin/env python3 | |
| import glob | |
| import hashlib | |
| import os | |
| import urllib.request | |
| def update_keys(local_user, github_user): | |
| with urllib.request.urlopen('https://github.com/%s.keys' % github_user) as f: |
| $ mkdir test | |
| $ python3 -m venv venv | |
| $ source venv/bin/activate | |
| $ pip install PySide2 | |
| $ cat << EOF > main.py | |
| import sys | |
| from PySide2.QtWidgets import QApplication, QLabel | |
| if __name__ == '__main__': |
| def static getenv(path = ".env") { | |
| def env = [:] | |
| def file = new File(path) | |
| if (file.exists()) { | |
| file.eachLine { line -> | |
| line = line.trim() | |
| if (line != "" && !line.startsWith("#")) { | |
| def pair = line.split("=", 2) | |
| env[pair[0].trim()] = pair.length == 2 ? pair[1].trim() : "" |
import io.swagger.converter.ModelConverters;
ModelConverters.getInstance().addConverter(new SnakeCaseConverter());
BeanConfig config = new BeanConfig();
config.setTitle("Swagger sample app");
config.setVersion("1.0.0");
config.setResourcePackage("io.swagger.sample.resource");
config.setScan(true);| """ | |
| This work is licensed under the MIT License (https://opensource.org/licenses/MIT) | |
| Example: | |
| class Example(Model): | |
| class Type(enum.Enum): | |
| one = 1 | |
| two = 2 |
| jenkins() { | |
| case "$1" in | |
| clean) | |
| rm -fr $( ls -d1 /tmp/*.jenkins ) | |
| return 0 | |
| ;; | |
| *) | |
| version="${1:-latest}"; shift | |
| dir="${1:-$( mktemp -d --suffix=.jenkins )}"; shift |