Clojurescript app for improving typing speed, made with re-frame and the re-pressed keyboard event library
A re-frame application for improving typing speed.
The app analyzes your keystrokes and identifies your "problem keys", then targets them without being annoying. All you type are actual common English words. Every now and then it nearly qualifies as AI-generated poetry.
I was in the wilderness slowly recovering from COVID without internet access, and was not able to find a typing app that was:
It was a really fun challenge making it without being able to ever google anything! No, I mean it. Actually, unironically fun. Highly recommend it. Unless, you know, you have a deadline.
I was previously using keybr when I had internet, but unfortunately once you finish "mastering" all the keys, it stops feeding you words based on the ones with which you need the most practice! I made sure to get this part right, I wanted it to always be helping me to improve, but it does it in a gentle way by just making sure that each word contains at least one of your "problem keys".
npm install
npm run dev
npx electron .
npm run build
npx electron-packager . HelloWorld --platform=darwin --arch=x64
shadow-cljs
/
: project config filesdev/
: source files compiled only with the dev profile
user.cljs
: symbols for use during development in theresources/public/
: SPA root directory;index.html
: SPA home page
div
:
<div id="app"></div>
js/compiled/
: compiled CLJS (shadow-cljs
)
.gitignore
src/typing/
: SPA source files (ClojureScript,core.cljs
: contains the SPA entry point, init
Use your preferred editor or IDE that supports Clojure/ClojureScript development. See Clojure tools for some popular options.
typing
project root directoryBrowser caching should be disabled when developer tools are open to prevent interference with
shadow-cljs
hot reloading.
Custom formatters must be enabled in the browser before CLJS DevTools can display ClojureScript data in the console in a more readable way.
F12
Ctrl-Shift-I
; macOS: -Option-I
)?
or F1
; macOS: ?
or Fn+F1
)Preferences
in the navigation menu on the left, if it is not already selectedNetwork
heading, enable the Disable cache (while DevTools is open)
optionConsole
heading, enable the Enable custom formatters
optionF12
orCtrl-Shift-I
; macOS: -Option-I
)F1
)Advanced settings
heading, enable the Disable HTTP Cache (when toolbox is open)
Unfortunately, Firefox does not yet support custom formatters in their devtools. For updates, follow the enhancement request in their bug tracker: 1262914 - Add support for Custom Formatters in devtools.
Start a temporary local web server, build the app with the dev
profile, and serve the app,
browser test runner and karma test runner with hot reload:
npm install
npx shadow-cljs watch app
Please be patient; it may take over 20 seconds to see any output, and over 40 seconds to complete.
When [:app] Build completed
appears in the output, browse to
http://localhost:8280/.
shadow-cljs
will automatically push ClojureScript code
changes to your browser on save. To prevent a few common issues, see
Hot Reload in ClojureScript: Things to avoid.
Opening the app in your browser starts a ClojureScript browser REPL, to which you may now connect.
See
Shadow CLJS User's Guide: Editor Integration.
Note that npm run watch
runs npx shadow-cljs watch
for you, and that this project's running build ids is
app
, browser-test
, karma-test
, or the keywords :app
, :browser-test
, :karma-test
in a Clojure context.
Alternatively, search the web for info on connecting to a shadow-cljs
ClojureScript browser REPL
from your editor and configuration.
For example, in Vim / Neovim with fireplace.vim
.cljs
file in the project to activate fireplace.vim
Piggieback
command with this project's running build id, :app
:
:Piggieback :app
Connect to the shadow-cljs
nREPL:
lein repl :connect localhost:8777
The REPL prompt, shadow.user=>
, indicates that is a Clojure REPL, not ClojureScript.
In the REPL, switch the session to this project's running build id, :app
:
(shadow.cljs.devtools.api/nrepl-select :app)
The REPL prompt changes to cljs.user=>
, indicating that this is now a ClojureScript REPL.
See user.cljs
for symbols that are immediately accessible in the REPL
without needing to require
.
shadow-cljs
ActionsSee a list of shadow-cljs CLI
actions:
npx shadow-cljs --help
Please be patient; it may take over 10 seconds to see any output. Also note that some actions shown may not actually be supported, outputting "Unknown action." when run.
Run a shadow-cljs action on this project's build id (without the colon, just app
):
npx shadow-cljs <action> app
The debug?
variable in config.cljs
defaults to true
in
dev
builds, and false
in prod
builds.
Use debug?
for logging or other tasks that should run only on dev
builds:
(ns typing.example
(:require [typing.config :as config])
(when config/debug?
(println "This message will appear in the browser console only on dev builds."))
Build the app with the prod
profile:
npm install
npm run release
Please be patient; it may take over 15 seconds to see any output, and over 30 seconds to complete.
The resources/public/js/compiled
directory is created, containing the compiled app.js
and
manifest.edn
files.