Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial commit

  • Loading branch information...
commit 48d51793368ced741e3d5fd48a7ba87b09a9c30d 0 parents
伴上段 authored
121 COPYING
@@ -0,0 +1,121 @@
+Creative Commons Legal Code
+
+CC0 1.0 Universal
+
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
+ HEREUNDER.
+
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer
+exclusive Copyright and Related Rights (defined below) upon the creator
+and subsequent owner(s) (each and all, an "owner") of an original work of
+authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for
+the purpose of contributing to a commons of creative, cultural and
+scientific works ("Commons") that the public can reliably and without fear
+of later claims of infringement build upon, modify, incorporate in other
+works, reuse and redistribute as freely as possible in any form whatsoever
+and for any purposes, including without limitation commercial purposes.
+These owners may contribute to the Commons to promote the ideal of a free
+culture and the further production of creative, cultural and scientific
+works, or to gain reputation or greater distribution for their Work in
+part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any
+expectation of additional consideration or compensation, the person
+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
+is an owner of Copyright and Related Rights in the Work, voluntarily
+elects to apply CC0 to the Work and publicly distribute the Work under its
+terms, with knowledge of his or her Copyright and Related Rights in the
+Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be
+protected by copyright and related or neighboring rights ("Copyright and
+Related Rights"). Copyright and Related Rights include, but are not
+limited to, the following:
+
+ i. the right to reproduce, adapt, distribute, perform, display,
+ communicate, and translate a Work;
+ ii. moral rights retained by the original author(s) and/or performer(s);
+iii. publicity and privacy rights pertaining to a person's image or
+ likeness depicted in a Work;
+ iv. rights protecting against unfair competition in regards to a Work,
+ subject to the limitations in paragraph 4(a), below;
+ v. rights protecting the extraction, dissemination, use and reuse of data
+ in a Work;
+ vi. database rights (such as those arising under Directive 96/9/EC of the
+ European Parliament and of the Council of 11 March 1996 on the legal
+ protection of databases, and under any national implementation
+ thereof, including any amended or successor version of such
+ directive); and
+vii. other similar, equivalent or corresponding rights throughout the
+ world based on applicable law or treaty, and any national
+ implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention
+of, applicable law, Affirmer hereby overtly, fully, permanently,
+irrevocably and unconditionally waives, abandons, and surrenders all of
+Affirmer's Copyright and Related Rights and associated claims and causes
+of action, whether now known or unknown (including existing as well as
+future claims and causes of action), in the Work (i) in all territories
+worldwide, (ii) for the maximum duration provided by applicable law or
+treaty (including future time extensions), (iii) in any current or future
+medium and for any number of copies, and (iv) for any purpose whatsoever,
+including without limitation commercial, advertising or promotional
+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
+member of the public at large and to the detriment of Affirmer's heirs and
+successors, fully intending that such Waiver shall not be subject to
+revocation, rescission, cancellation, termination, or any other legal or
+equitable action to disrupt the quiet enjoyment of the Work by the public
+as contemplated by Affirmer's express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason
+be judged legally invalid or ineffective under applicable law, then the
+Waiver shall be preserved to the maximum extent permitted taking into
+account Affirmer's express Statement of Purpose. In addition, to the
+extent the Waiver is so judged Affirmer hereby grants to each affected
+person a royalty-free, non transferable, non sublicensable, non exclusive,
+irrevocable and unconditional license to exercise Affirmer's Copyright and
+Related Rights in the Work (i) in all territories worldwide, (ii) for the
+maximum duration provided by applicable law or treaty (including future
+time extensions), (iii) in any current or future medium and for any number
+of copies, and (iv) for any purpose whatsoever, including without
+limitation commercial, advertising or promotional purposes (the
+"License"). The License shall be deemed effective as of the date CC0 was
+applied by Affirmer to the Work. Should any part of the License for any
+reason be judged legally invalid or ineffective under applicable law, such
+partial invalidity or ineffectiveness shall not invalidate the remainder
+of the License, and in such case Affirmer hereby affirms that he or she
+will not (i) exercise any of his or her remaining Copyright and Related
+Rights in the Work or (ii) assert any associated claims and causes of
+action with respect to the Work, in either case contrary to Affirmer's
+express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
+ surrendered, licensed or otherwise affected by this document.
+ b. Affirmer offers the Work as-is and makes no representations or
+ warranties of any kind concerning the Work, express, implied,
+ statutory or otherwise, including without limitation warranties of
+ title, merchantability, fitness for a particular purpose, non
+ infringement, or the absence of latent or other defects, accuracy, or
+ the present or absence of errors, whether or not discoverable, all to
+ the greatest extent permissible under applicable law.
+ c. Affirmer disclaims responsibility for clearing rights of other persons
+ that may apply to the Work or any use thereof, including without
+ limitation any person's Copyright and Related Rights in the Work.
+ Further, Affirmer disclaims responsibility for obtaining any necessary
+ consents, permissions or other rights required for any use of the
+ Work.
+ d. Affirmer understands and acknowledges that Creative Commons is not a
+ party to this document and has no duty or obligation with respect to
+ this CC0 or use of the Work.
77 README.md
@@ -0,0 +1,77 @@
+
+# Honden: A Flashcard System Built on Oboeta
+
+This is a collection of scripts built on top of [Oboeta], my minimalistic flashcard system. All cards are stored as plain UTF-8 text in flat files: associated media files are stored in subdirectories.
+
+## Installing
+
+Open a terminal, navigate to the directory containing Honden's source code, and execute the `install.sh` script, passing the directory where you want to install the scripts as the first parameter. The installation script will also create the proper directory hierarchy if it isn't already present; see the next section for more information about the directory hierarchy.
+
+For example:
+
+ $ ./install.sh ~/flashcards
+
+will copy the scripts to `~/flashcards` and create subdirectories if necessary. You might have to change users (e.g., run `sudo`) depending on which installation directory you select.
+
+## The Directory Hierarchy
+
+Assuming `.` is the root directory of a Honden installation, the directory hierarchy looks like this:
+
+ ./
+ backups/
+ This directory contains backup archives created by
+ backupall and backupcards. These are bzipped
+ TARs (.tar.bz2).
+ decks/
+ This directory contains plain text flashcard deck and
+ log files. Deck files have a .txt extension and log
+ files have a .log extension. Deck and log files are
+ associated by name. For example, a deck named
+ kanji.txt would have a log file named kanji.log.
+ media/
+ recordings/
+ flashcards/
+ ロー/
+ This directory contains recordings of flashcards.
+ Each recording's name is the integral ID of the
+ associated flashcard followed by the .wav
+ extension. If there are multiple recordings for
+ a single flashcard, then the first one is named
+ as just mentioned, whereas subsequent recordings'
+ names are the flashcard's unique ID followed by
+ ".N", where N is the recording's zero-based index,
+ and the .wav extension.
+ sds/
+ This directory contains Chinese character stroke
+ order diagrams. Each file's name is the character
+ that the file describes followed by an image extension.
+ Right now, all of my diagrams are PNGs.
+ other/
+ This directory contains miscellaneous data. Honden
+ ignores it.
+
+## The Scripts
+
+Most of the scripts use the Bourne shell (`sh`) and the standard `awk` (actually, some rely on `gawk`), `date`, `sed`, and `sort` utilities. All of them should be easy to understand: Open them with your favorite text editor to check them out. Here's a high-level overview of the most important ones:
+
+* `backupall` and `backupcards` back up all files and just cards and the scripts, respectively, to the `backups` directory.
+* `carddate` generates a timestamp suitable for use in flashcards.
+* `logdate` generates a timestamp suitable for use in logs.
+* `edeck` edits the specified deck with your favorite text editor, whereas `seedeck` just views it via `less`.
+* `newdeck` creates a new deck and associated log file using `touch(1)`.
+* `nextid` scans all decks and log files for the next unique integral flashcard ID.
+* `genline` is a handy script that appends new cards generated from its parameters to the specified deck. It automatically generates the cards' unique IDs and adds blank rubi annotations for kanji (Chinese) characters via `rubify`.
+* `reviewsome` is the driver behind `reviewsentences` and `reviewkanji`. It uses SM-2 to select flashcards from the specified deck and sets up a local HTTP server on port 1337 to review them. It requires a "filter program" to transform `oboeta`'s output into suitable lines for `oboetahttp`. Honden has two filters, `filterkanji` and `filtersentences`, for kanji decks and Japanese sentence decks, respectively. `reviewkanji` and `reviewsentences` set all of this up for you assuming that you have decks named "kanji" and "sentences".
+* `seesome` is identical to `reviewsome` but does not log review results.
+
+NOTE: Some of the Japanese-specific scripts depend on [Hinomoto](https://github.com/joodan-van-github/hinomoto), a small collection of programs for parsing and tagging Unicode text. Of course, you can remove these dependencies.
+
+## License
+
+All of the files in this collection have been dedicated to the public domain via the Creative Commons CC0 Public Domain Dedication in the hope that they would be circulated widely and without restriction. I won't make any money from this code and I feel that it's more important that other people are free to use, modify, and distribute it as they please, with or without charge, even if I could make money from this. Simply put, I like contributing to a healthy public domain. See the file `COPYING` for a complete copy of the public domain dedication.
+
+## Authors
+
+I wrote these scripts by myself primarily for myself, but I hope that others will find them useful.
+
+-- Joodan Van (伴上段), 2012年11月22日
15 backupall
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Back Up Everything in the Current Directory to the "backups" Subdirectory
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+tar -cv `ls | grep -v 'backups'` | bzip2 -9 >backups/`date +'%Y年%m月%d日%H時%M分%S秒'`.all.tar.bz2
+
16 backupcards
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Back Up Everything in the Current Directory Except "media" and "other" to
+# the "backups" Directory
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+tar -cv `ls | grep -v 'backups' | grep -v 'media' | grep -v 'other'` | bzip2 -9 >backups/`date +'%Y年%m月%d日%H時%M分%S秒'`.cards.tar.bz2
+
14 carddate
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Generate a Timestamp Suitable for Cards
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+date +'%Y年%m月%d日%H時%M分'
28 downloadsds
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# Download Stroke Order Diagrams for All Kanji Characters in Stdin
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+ret=0
+for cp in `dunicode | uniquhan`; do
+ ch=`echo $cp | eunicode -n`
+ if [ ! -f $ch.png ]; then
+ echo $ch
+ curl -f -o $ch.png http://jisho.org/static/images/stroke_diagrams/${cp}_frames.png
+ if [ $? -ne 0 ]; then
+ rm -f $ch.png
+ echo "Failed to download $ch.png" >&2
+ ret=1
+ fi
+ fi
+done
+exit $ret
+
27 edeck
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# Edit the Specified Deck with Your Favorite Text Editor
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+usage() {
+ echo "Usage: `basename $0` [-h] deck-name-no-extension"
+}
+
+if [ $# -ne 1 ]; then
+ usage >&2
+ exit 1
+elif [ "$1" = "-h" ]; then
+ usage
+ exit 0
+fi
+
+leafpad decks/$1.txt
+
28 filterkanji
@@ -0,0 +1,28 @@
+#!/usr/bin/gawk -f
+
+# Transform Kanji Flashcard Lines into Readable Forms for Review Scripts
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+BEGIN { FS = "\t"; }
+{
+ if (NF > 3 && $4 != "") {
+ printf("%s", $1)
+ for (i = 4; i < NF; i++) {
+ printf("\t%s", $i)
+ }
+ printf("\n")
+ } else {
+ print $1 "\t" $3
+ }
+ printf("%s\t<img src=\"/media/sds/%s.png\">\n", $3, $3)
+ system("")
+}
+
32 filtersentences
@@ -0,0 +1,32 @@
+#!/usr/bin/gawk -f
+
+# Transform Sentence Flashcard Lines into Readable Forms for Review Scripts
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+BEGIN { FS = "\t" }
+{
+ firstsound = 0
+ print $1 "\t" $3
+ printf("%s", $4)
+ for (i = 5; i <= NF; i++) {
+ if ($i == "") {
+ printf("\t<a href=\"javascript:window.open('/media/recordings/flashcards/ロー/%s", $1)
+ if (firstsound != 0) {
+ printf("." firstsound)
+ }
+ printf(".wav')\">Listen to Audio</a>")
+ firstsound = firstsound + 1
+ }
+ }
+ printf("\n")
+ system("")
+}
+
41 genkanjicards
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# Add New Flashcards for the Specified Kanji
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+# This adds kanji from standard input that are not in the
+# specified flashcard deck file to that deck file.
+
+usage() {
+ echo "Usage: `basename $0` [-h] kanji-deck-name-no-extension"
+}
+
+if [ $# -ne 1 ]; then
+ usage >&2
+ exit 1
+elif [ "$1" = "-h" ]; then
+ usage
+ exit 0
+fi
+
+cleanup() {
+ rm -f $tmpfile
+}
+trap cleanup EXIT
+tmpfile=`mktemp genkanjicards.holdings.XXXXXXXX`
+
+dunicode | uniquhan >$tmpfile
+for kanji in `dunicode <decks/$1.txt | uniquhan | comm -2 -3 $tmpfile - | eunicode -n`; do
+ echo "`nextid` `carddate` $kanji " >>decks/$1.txt
+done
+
+edeck $1
+
35 genline
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# Automatically Generate a Card for the Specified Deck and Open the Deck
+# for Editing
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+usage() {
+ echo "Usage: `basename $0` [-h] deck-name-no-extension card-text [card-text ...]"
+}
+
+if [ $# -eq 1 -a "$1" = "-h" ]; then
+ usage
+ exit 0
+elif [ $# -lt 2 ]; then
+ usage >&2
+ exit 1
+fi
+
+deckname=$1
+shift
+deck=decks/$deckname.txt
+while [ $# -ne 0 ]; do
+ echo "`./nextid` `./carddate` $1 `echo $1 | dunicode | annouhan '[' ':]' | eunicode`" | tee -a $deck
+ shift
+done
+exec edeck $deckname
+
14 getsds
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Download Stroke Order Diagrams for All Decks and Log Files
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+cd media/sds && ( cat ../../decks/* | ../../downloadsds )
33 install.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# Honden Installation Script
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+if [ $# -eq 0 ]; then
+ echo "ERROR: No installation directory specified. Please specify it as the first command-line argument for this script." >&2
+ exit 1
+fi
+if [ ! -d "$1" ]; then
+ echo "ERROR: $1 is not a directory." >&2
+ exit 1
+fi
+
+echo "Creating directory hierarchy"
+mkdir -p -m 0755 $1/backups
+mkdir -p -m 0755 $1/decks
+mkdir -p -m 0755 $1/media/recordings/flashcards/ロー
+mkdir -p -m 0755 $1/media/sds
+mkdir -p -m 0755 $1/other
+
+echo "Installing scripts"
+set -x
+install backupall backupcards carddate downloadsds edeck filterkanji filtersentences genkanjicards genline getsds logdate newdeck nextid reviewkanji reviewsentences reviewsome rubify seedeck seesome $1
+
14 logdate
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Generate a Timestamp Suitable for Logs
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+date +'%Y年%m月%d日'
27 newdeck
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# Generate New Deck and Log Files
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+usage() {
+ echo "Usage: `basename $0` [-h] deck-name-no-extension"
+}
+
+if [ $# -ne 1 ]; then
+ usage >&2
+ exit 1
+elif [ "$1" = "-h" ]; then
+ usage
+ exit 0
+fi
+
+touch decks/$1.txt decks/$1.log
+
17 nextid
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Get the Next Unique Numeric ID for a New Card
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+cat decks/*.txt decks/*.log | awk 'BEGIN { max = 0; }
+{ val = int($1); if (val > max) { max = val; } }
+END { print max + 1 }'
+
15 reviewkanji
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Review Kanji Flashcards over HTTP
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+reviewsome kanji filterkanji
+
15 reviewsentences
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Review Sentence Flashcards over HTTP
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+reviewsome sentences filtersentences
+
41 reviewsome
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# Review Cards from the Specified Deck over HTTP
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+usage() {
+ echo "Usage: `basename $0` [-h] deck-name-no-extension card-filter-program"
+}
+
+if [ $# -le 4 -a "$1" = "-h" ]; then
+ usage
+ exit 0
+elif [ $# -ne 2 ]; then
+ usage >&2
+ exit 1
+fi
+
+cpipe=reviewsome.$$.command
+cleanup() {
+ rm -f $cpipe
+}
+trap cleanup EXIT INT
+mkfifo -m 0700 $cpipe
+
+osm2 -n 30 -e 10 decks/$1.log <decks/$1.txt | rubify | oboeta -2 $cpipe decks/$1.log | awk '
+{
+ for (n = 1; n <= NF - 5; n++) {
+ printf("%s\t", $n)
+ }
+ printf("%s\n", $(NF - 4))
+ system("")
+}' | $2 | oboetahttp -2 -n '\"HanaMinA\", sans-serif' -i 48 >$cpipe
+
15 rubify
@@ -0,0 +1,15 @@
+#!/bin/sed -f
+
+# Transform [:] Ruby Annotations from Standard Input into HTML5 Ruby Constructs
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+s|\[\([^]:]*\):\([^]]*\)\]|<ruby>\1<rp>(</rp><rt>\2</rt><rp>)</rp></ruby>|g
+
27 seedeck
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# View the Specified Deck with Less
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+usage() {
+ echo "Usage: `basename $0` [-h] deck-name-no-extension"
+}
+
+if [ $# -ne 1 ]; then
+ usage >&2
+ exit 1
+elif [ "$1" = "-h" ]; then
+ usage
+ exit 0
+fi
+
+less decks/$1.txt
+
42 seesome
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# Review Cards from the Specified Deck over HTTP (Dry Run: No Logs)
+# Written in 2012 by 伴上段
+#
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
+#
+# You should have received a copy of the CC0 Public Domain Dedication along
+# with this software. If not, see
+# <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+usage() {
+ echo "Usage: `basename $0` [-h] deck-name-no-extension card-filter-program"
+}
+
+if [ $# -le 4 -a "$1" = "-h" ]; then
+ usage
+ exit 0
+elif [ $# -ne 2 ]; then
+ usage >&2
+ exit 1
+fi
+
+cpipe=reviewsome.$$.command
+cleanup() {
+ rm -f $cpipe
+}
+trap cleanup EXIT
+trap cleanup INT
+mkfifo -m 0700 $cpipe
+
+osm2 -n 30 -e 10 decks/$1.log <decks/$1.txt | rubify | oboeta -d -2 $cpipe decks/$1.log | awk '
+{
+ for (n = 1; n <= NF - 5; n++) {
+ printf("%s\t", $n)
+ }
+ printf("%s\n", $(NF - 4))
+ system("")
+}' | $2 | oboetahttp -2 -n '\"HanaMinA\", sans-serif' -i 48 >$cpipe
+
Please sign in to comment.
Something went wrong with that request. Please try again.