Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rm-hull/scratchpad
https://github.com/rm-hull/scratchpad
react scratchpad typescript
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rm-hull/scratchpad
- Owner: rm-hull
- License: mit
- Created: 2022-11-26T23:22:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-02T16:11:14.000Z (3 months ago)
- Last Synced: 2024-10-03T12:17:26.317Z (3 months ago)
- Topics: react, scratchpad, typescript
- Language: TypeScript
- Homepage: https://www.destructuring-bind.org/scratchpad/
- Size: 4.73 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 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).![main](./doc/screenshots/main.webp)
[Math.JS](https://mathjs.org/docs/index.html) 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):* https://www.destructuring-bind.org/scratchpad/diary/2024
* https://www.destructuring-bind.org/scratchpad/recipies
* https://www.destructuring-bind.org/scratchpad/work-stuffThere is no practical limit to the number of namespaces, however note that:
* non-alphabetical characters are treated the same so https://www.destructuring-bind.org/scratchpad/diary/2024 and
https://www.destructuring-bind.org/scratchpad/diary-2024 resolve to the same namespace.
* namespaces are case-insensitive, so https://www.destructuring-bind.org/scratchpad/recipies and
https://www.destructuring-bind.org/scratchpad/Recipies would resolve the the same namespace.## Running locally
You must have Node 20 and Yarn installed. To begin:
```console
yarn install
yarn dev
```If you want to test Sync behaviour, you will need to create a project in [Google Developer Console](https://console.cloud.google.com/apis/credentials)
and create an OAuth 2.0 Client ID. Stop the server, and restart with:```console
export VITE_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.