scratchpad

MIT License

Stars
1

Scratchpad

Scratchpad is a small web app that allows you to store snippets & miscellaneous notes as "blocks" in your browser's local storage. They never leave your machine (unless you want to sync them to your Google Drive). Many file formats are supported, and it will do syntax coloring and pretty-print formatting (especially useful for JSON).

Math.JS is integrated as a file type, giving a capable calculator functionality with currency conversion (FX rates provided by an ECB API).

Each block has a toolbar of options, and you can right-click to get a context menu allowing you to alter settings and sync to Google.

Keyboard shortcuts

On MacOS,

   / - Search

   ENTER - Add new block

   . - Base64-decode selected text

For Windows/Linux, use CTRL rather than .

Go to https://www.destructuring-bind.org/scratchpad to see it in action.

Namespaces

The "default" namespace is hosted at https://www.destructuring-bind.org/scratchpad, but you can add anything after the main URL to organise scratchpad blocks into separate namespaces, so you could have the following URLs, all which are isolated (both the blocks, their own settings configuration and Google Drive synchronisation):

There is no practical limit to the number of namespaces, however note that:

Running locally

You must have Node 20 and Yarn installed. To begin:

yarn install
yarn dev

If you want to test Sync behaviour, you will need to create a project in Google Developer Console and create an OAuth 2.0 Client ID. Stop the server, and restart with:

export VITE_GOOGLE_API_CLIENT_ID=<your-google-api-client-id>
yarn dev

This is not mandatory however, and if omitted, the sync capability will be marked as disabled in the context menu.

License

MIT License

Copyright (c) 2023 Richard Hull

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.