Initial commit
This commit is contained in:
16
.eslintrc.json
Normal file
16
.eslintrc.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2021": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": "eslint:recommended",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": "latest",
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"no-unused-vars": "warn",
|
||||||
|
"no-console": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
23
.foam/templates/concept-note.md
Normal file
23
.foam/templates/concept-note.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
type: concept
|
||||||
|
created: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}
|
||||||
|
tags: []
|
||||||
|
---
|
||||||
|
|
||||||
|
# ${TM_FILENAME_BASE}
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
## Key Ideas
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
## Related Concepts
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
## References
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
---
|
||||||
20
.foam/templates/daily-note.md
Normal file
20
.foam/templates/daily-note.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}
|
||||||
|
type: daily
|
||||||
|
---
|
||||||
|
|
||||||
|
# ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}
|
||||||
|
|
||||||
|
## 📝 Notes
|
||||||
|
|
||||||
|
## ✅ Completed
|
||||||
|
|
||||||
|
## 🎯 Focus
|
||||||
|
|
||||||
|
## 🔗 Links
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[[daily-notes]]
|
||||||
43
.github/ISSUE_TEMPLATE/bookmarklet-request.md
vendored
Normal file
43
.github/ISSUE_TEMPLATE/bookmarklet-request.md
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
name: 🔖 Bookmarklet Request
|
||||||
|
about: Idea for a new bookmarklet or browser utility
|
||||||
|
title: "[BOOKMARKLET] "
|
||||||
|
labels: ["bookmarklet", "enhancement"]
|
||||||
|
assignees: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
<!-- What should this bookmarklet do? -->
|
||||||
|
|
||||||
|
## Use Case
|
||||||
|
|
||||||
|
<!-- When/where would you use this? -->
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
<!-- Describe the expected behavior -->
|
||||||
|
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
|
||||||
|
## Technical Considerations
|
||||||
|
|
||||||
|
<!-- Any specific requirements or constraints? -->
|
||||||
|
|
||||||
|
- Browser compatibility:
|
||||||
|
- Required permissions:
|
||||||
|
- Dependencies: None (bookmarklets should be self-contained)
|
||||||
|
|
||||||
|
## Inspiration
|
||||||
|
|
||||||
|
<!-- Any existing tools or examples? -->
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
## Implementation Notes
|
||||||
|
|
||||||
|
<!-- Technical approach or ideas -->
|
||||||
|
|
||||||
|
-
|
||||||
40
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
40
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
name: 🐛 Bug/Issue
|
||||||
|
about: Report a problem with code or documentation
|
||||||
|
title: "[BUG] "
|
||||||
|
labels: ["bug"]
|
||||||
|
assignees: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
<!-- Clear description of the issue -->
|
||||||
|
|
||||||
|
## Location
|
||||||
|
|
||||||
|
<!-- Where is the problem? -->
|
||||||
|
|
||||||
|
- File:
|
||||||
|
- Section:
|
||||||
|
|
||||||
|
## Expected Behavior
|
||||||
|
|
||||||
|
<!-- What should happen? -->
|
||||||
|
|
||||||
|
## Actual Behavior
|
||||||
|
|
||||||
|
<!-- What actually happens? -->
|
||||||
|
|
||||||
|
## Steps to Reproduce
|
||||||
|
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
|
||||||
|
## Possible Fix
|
||||||
|
|
||||||
|
<!-- If you have ideas on how to fix it -->
|
||||||
|
|
||||||
|
## Additional Context
|
||||||
|
|
||||||
|
<!-- Screenshots, error messages, etc. -->
|
||||||
46
.github/ISSUE_TEMPLATE/code-experiment.md
vendored
Normal file
46
.github/ISSUE_TEMPLATE/code-experiment.md
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
name: 🧪 Code Experiment
|
||||||
|
about: Track a code experiment or prototype
|
||||||
|
title: "[EXPERIMENT] "
|
||||||
|
labels: ["experiment", "code"]
|
||||||
|
assignees: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
## Experiment Goal
|
||||||
|
|
||||||
|
<!-- What are you trying to learn or build? -->
|
||||||
|
|
||||||
|
## Language/Stack
|
||||||
|
|
||||||
|
<!-- Python, JavaScript, TypeScript, etc. -->
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
## Hypothesis
|
||||||
|
|
||||||
|
<!-- What do you expect to discover or achieve? -->
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<!-- Outline the experiment -->
|
||||||
|
|
||||||
|
- [ ] Setup/preparation
|
||||||
|
- [ ] Implementation
|
||||||
|
- [ ] Testing
|
||||||
|
- [ ] Documentation
|
||||||
|
|
||||||
|
## Location
|
||||||
|
|
||||||
|
<!-- Where will this code live? -->
|
||||||
|
|
||||||
|
- Path: `/code/scratchpad/`
|
||||||
|
|
||||||
|
## Success Criteria
|
||||||
|
|
||||||
|
<!-- How will you know if this experiment succeeded? -->
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
<!-- Any additional context or considerations -->
|
||||||
36
.github/ISSUE_TEMPLATE/concept-idea.md
vendored
Normal file
36
.github/ISSUE_TEMPLATE/concept-idea.md
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
name: 💡 Concept/Idea
|
||||||
|
about: Capture a new concept or idea to develop
|
||||||
|
title: "[CONCEPT] "
|
||||||
|
labels: ["concept", "documentation"]
|
||||||
|
assignees: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
## Concept Summary
|
||||||
|
|
||||||
|
<!-- Brief description of the concept or idea -->
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
<!-- Where did this idea come from? What problem does it address? -->
|
||||||
|
|
||||||
|
## Related Concepts
|
||||||
|
|
||||||
|
<!-- Link to related notes or concepts -->
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
## Actions
|
||||||
|
|
||||||
|
<!-- What needs to be done to develop this concept? -->
|
||||||
|
|
||||||
|
- [ ] Create initial note in `/docs/fleeting/` or `/docs/concepts/`
|
||||||
|
- [ ] Research and gather information
|
||||||
|
- [ ] Link to related concepts
|
||||||
|
- [ ] Refine and expand
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
<!-- Links, references, inspiration -->
|
||||||
|
|
||||||
|
-
|
||||||
16
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
16
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: Choose a template
|
||||||
|
description: Select the appropriate issue template for your needs
|
||||||
|
title: ""
|
||||||
|
labels: []
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
## Welcome to Memory Palace Issues!
|
||||||
|
|
||||||
|
Choose the template that best fits your need:
|
||||||
|
- 💡 **Concept/Idea** - Capture new concepts or ideas
|
||||||
|
- 🔖 **Bookmarklet** - Request or plan a browser utility
|
||||||
|
- 🧪 **Code Experiment** - Track experiments and prototypes
|
||||||
|
- 📚 **Project** - Document larger projects
|
||||||
|
- 🐛 **Bug/Issue** - Report problems
|
||||||
55
.github/ISSUE_TEMPLATE/project-documentation.md
vendored
Normal file
55
.github/ISSUE_TEMPLATE/project-documentation.md
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
name: 📚 Project Documentation
|
||||||
|
about: Track documentation for a larger project
|
||||||
|
title: "[PROJECT] "
|
||||||
|
labels: ["project", "documentation"]
|
||||||
|
assignees: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
## Project Name
|
||||||
|
|
||||||
|
<!-- What is this project? -->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
<!-- Brief overview -->
|
||||||
|
|
||||||
|
## Goals
|
||||||
|
|
||||||
|
<!-- What are you trying to accomplish? -->
|
||||||
|
|
||||||
|
-
|
||||||
|
-
|
||||||
|
|
||||||
|
## Documentation Structure
|
||||||
|
|
||||||
|
- [ ] Create project folder in `/docs/projects/`
|
||||||
|
- [ ] Project overview/README
|
||||||
|
- [ ] Technical documentation
|
||||||
|
- [ ] Decision log
|
||||||
|
- [ ] Resources and references
|
||||||
|
|
||||||
|
## Related Code
|
||||||
|
|
||||||
|
<!-- Any code components? -->
|
||||||
|
|
||||||
|
- Location:
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
<!-- Current state of the project -->
|
||||||
|
|
||||||
|
- [ ] Planning
|
||||||
|
- [ ] In Progress
|
||||||
|
- [ ] Paused
|
||||||
|
- [ ] Completed
|
||||||
|
- [ ] Archived
|
||||||
|
|
||||||
|
## Next Steps
|
||||||
|
|
||||||
|
- [ ]
|
||||||
|
- [ ]
|
||||||
|
|
||||||
|
## Links & Resources
|
||||||
|
|
||||||
|
-
|
||||||
44
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
44
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
## Description
|
||||||
|
|
||||||
|
<!-- Brief description of changes -->
|
||||||
|
|
||||||
|
## Type of Change
|
||||||
|
|
||||||
|
<!-- Mark the relevant option -->
|
||||||
|
|
||||||
|
- [ ] 📝 Documentation (notes, concepts, project docs)
|
||||||
|
- [ ] 🔖 Bookmarklet (new or updated browser utility)
|
||||||
|
- [ ] 🧪 Code (scratchpad experiments, templates)
|
||||||
|
- [ ] 🔧 Configuration (settings, tools, structure)
|
||||||
|
- [ ] 🐛 Bug fix
|
||||||
|
|
||||||
|
## Changes Made
|
||||||
|
|
||||||
|
<!-- List specific changes -->
|
||||||
|
|
||||||
|
-
|
||||||
|
-
|
||||||
|
|
||||||
|
## Related Issues
|
||||||
|
|
||||||
|
<!-- Link any related issues -->
|
||||||
|
|
||||||
|
Closes #
|
||||||
|
|
||||||
|
## Files Changed
|
||||||
|
|
||||||
|
<!-- Key files or areas affected -->
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
|
||||||
|
- [ ] Changes are documented
|
||||||
|
- [ ] Code is tested (if applicable)
|
||||||
|
- [ ] Links are valid
|
||||||
|
- [ ] Follows project conventions
|
||||||
|
- [ ] Commits follow conventional format
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
<!-- Any additional context or considerations -->
|
||||||
69
.github/README.md
vendored
Normal file
69
.github/README.md
vendored
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
# Memory Palace - GitHub Structure
|
||||||
|
|
||||||
|
This directory contains templates and configurations for GitHub.
|
||||||
|
|
||||||
|
## 📁 Structure
|
||||||
|
|
||||||
|
### `copilot-instructions.md`
|
||||||
|
|
||||||
|
GitHub Copilot instructions that guide AI assistance for this workspace. Defines:
|
||||||
|
|
||||||
|
- Project overview and structure
|
||||||
|
- Documentation and code conventions
|
||||||
|
- File organization and naming
|
||||||
|
- Commit practices
|
||||||
|
|
||||||
|
### `ISSUE_TEMPLATE/`
|
||||||
|
|
||||||
|
Issue templates for tracking:
|
||||||
|
|
||||||
|
- **concept-idea.md** - New concepts and ideas
|
||||||
|
- **bookmarklet-request.md** - Browser utility requests
|
||||||
|
- **code-experiment.md** - Code experiments and prototypes
|
||||||
|
- **project-documentation.md** - Larger project tracking
|
||||||
|
- **bug-report.md** - Bug reports and issues
|
||||||
|
- **config.yml** - Template configuration
|
||||||
|
|
||||||
|
### `PULL_REQUEST_TEMPLATE.md`
|
||||||
|
|
||||||
|
Template for pull requests (if collaborating or tracking larger changes)
|
||||||
|
|
||||||
|
## 🎯 Usage
|
||||||
|
|
||||||
|
### For Issues
|
||||||
|
|
||||||
|
Use issues to track:
|
||||||
|
|
||||||
|
- Ideas you want to develop into notes
|
||||||
|
- Bookmarklets you want to build
|
||||||
|
- Code experiments
|
||||||
|
- Project planning
|
||||||
|
- Problems to fix
|
||||||
|
|
||||||
|
### For Copilot
|
||||||
|
|
||||||
|
The instructions file helps Copilot:
|
||||||
|
|
||||||
|
- Understand your project structure
|
||||||
|
- Suggest appropriate file locations
|
||||||
|
- Follow your naming conventions
|
||||||
|
- Generate code matching your style
|
||||||
|
- Create documentation in your format
|
||||||
|
|
||||||
|
## 🔧 Customization
|
||||||
|
|
||||||
|
Feel free to:
|
||||||
|
|
||||||
|
- Add new issue templates for your workflows
|
||||||
|
- Modify the copilot instructions as your needs evolve
|
||||||
|
- Create additional GitHub workflows
|
||||||
|
- Add labels in the repository settings
|
||||||
|
|
||||||
|
## 📝 Future Additions
|
||||||
|
|
||||||
|
Consider adding:
|
||||||
|
|
||||||
|
- `workflows/` - GitHub Actions for automation
|
||||||
|
- `CODEOWNERS` - If you collaborate with others
|
||||||
|
- `FUNDING.yml` - If you want to add sponsorship options
|
||||||
|
- Label definitions and automation
|
||||||
188
.github/copilot-instructions.md
vendored
Normal file
188
.github/copilot-instructions.md
vendored
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
# GitHub Copilot Instructions for Memory Palace
|
||||||
|
|
||||||
|
## Project Overview
|
||||||
|
|
||||||
|
This is a hybrid workspace combining:
|
||||||
|
|
||||||
|
- **Documentation**: Obsidian-style knowledge management with wiki-links and backlinks
|
||||||
|
- **Code Development**: Bookmarklets, scratchpad code, and project prototypes
|
||||||
|
|
||||||
|
## Documentation Guidelines
|
||||||
|
|
||||||
|
### Writing Style
|
||||||
|
|
||||||
|
- Use clear, concise markdown
|
||||||
|
- Employ wiki-style `[[links]]` for connecting notes
|
||||||
|
- Include frontmatter metadata in notes (date, type, tags)
|
||||||
|
- Keep daily notes in `/docs/daily/` with format `daily-YYYY-MM-DD.md`
|
||||||
|
- Place evergreen concept notes in `/docs/concepts/`
|
||||||
|
|
||||||
|
### Note Structure
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
---
|
||||||
|
type: concept|project|fleeting
|
||||||
|
created: YYYY-MM-DD
|
||||||
|
tags: []
|
||||||
|
---
|
||||||
|
|
||||||
|
# Title
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Brief summary
|
||||||
|
|
||||||
|
## Content
|
||||||
|
|
||||||
|
Main content with [[links]]
|
||||||
|
|
||||||
|
## Related
|
||||||
|
|
||||||
|
- [[other-note]]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Code Development Guidelines
|
||||||
|
|
||||||
|
### Bookmarklets (`/code/bookmarklets/`)
|
||||||
|
|
||||||
|
- Write as regular Node.js-compatible JavaScript files
|
||||||
|
- Use modern ES6+ syntax, let/const, etc. (will be minified)
|
||||||
|
- Include JSDoc comments for documentation (removed in final bookmarklet)
|
||||||
|
- Write clear, readable code - the generator handles minification
|
||||||
|
- Use descriptive variable and function names
|
||||||
|
- Test logic in Node.js if possible before converting
|
||||||
|
|
||||||
|
**Conversion Process:**
|
||||||
|
|
||||||
|
1. Write bookmarklet as normal `.js` file in `/code/bookmarklets/`
|
||||||
|
2. Run: `npm run bookmarklet -- code/bookmarklets/your-file.js`
|
||||||
|
3. Generator automatically:
|
||||||
|
- Removes all comments
|
||||||
|
- Minifies code
|
||||||
|
- Wraps in IIFE: `javascript:(function(){...})();`
|
||||||
|
- Copies to clipboard
|
||||||
|
4. Paste into browser bookmark URL field
|
||||||
|
|
||||||
|
### Scratchpad Code (`/code/scratchpad/`)
|
||||||
|
|
||||||
|
- This is experimental space - be creative
|
||||||
|
- Add `TODO:` comments for work in progress
|
||||||
|
- Use descriptive variable names
|
||||||
|
- Include usage examples
|
||||||
|
- Python: Follow PEP 8 style
|
||||||
|
- JavaScript/TypeScript: Use modern ES6+ syntax
|
||||||
|
|
||||||
|
### Code Style
|
||||||
|
|
||||||
|
- **Python**: PEP 8, type hints preferred
|
||||||
|
- **JavaScript**: Modern ES6+, const/let over var, **ES modules (import/export)**
|
||||||
|
- **TypeScript**: Explicit types, interfaces over types
|
||||||
|
- Comments: Explain _why_, not _what_
|
||||||
|
- Functions: Single responsibility, descriptive names
|
||||||
|
|
||||||
|
### Module System
|
||||||
|
|
||||||
|
**This project uses ES modules (import/export), not CommonJS (require).**
|
||||||
|
|
||||||
|
- Use `import` for dependencies: `import fs from 'fs';`
|
||||||
|
- Use `export` for exporting: `export default myFunction;` or `export { myFunction };`
|
||||||
|
- Package.json is configured with `"type": "module"`
|
||||||
|
- Use `.js` extension for ES modules
|
||||||
|
- For Node.js built-ins requiring special handling: `import { fileURLToPath } from 'url';`
|
||||||
|
|
||||||
|
## File Organization
|
||||||
|
|
||||||
|
### When to Create Files
|
||||||
|
|
||||||
|
- **Fleeting notes**: Quick captures, temporary thoughts → `/docs/fleeting/`
|
||||||
|
- **Concept notes**: Refined ideas, evergreen content → `/docs/concepts/`
|
||||||
|
- **Project docs**: Specific project documentation → `/docs/projects/`
|
||||||
|
- **Bookmarklets**: Browser utilities → `/code/bookmarklets/`
|
||||||
|
- **Experiments**: Testing/learning → `/code/scratchpad/`
|
||||||
|
|
||||||
|
### Naming Conventions
|
||||||
|
|
||||||
|
- Documentation: `kebab-case.md` (e.g., `my-note.md`)
|
||||||
|
- JavaScript: `kebab-case.js` (e.g., `my-bookmarklet.js`)
|
||||||
|
- Python: `snake_case.py` (e.g., `my_script.py`)
|
||||||
|
- TypeScript: `kebab-case.ts` (e.g., `my-module.ts`)
|
||||||
|
|
||||||
|
## Git Commit Practices
|
||||||
|
|
||||||
|
GitDoc auto-commits on save. For manual commits:
|
||||||
|
|
||||||
|
- Use conventional commits: `type: description`
|
||||||
|
- Types: `docs:`, `feat:`, `fix:`, `refactor:`, `chore:`
|
||||||
|
- Examples:
|
||||||
|
- `docs: add note on memory techniques`
|
||||||
|
- `feat: create bookmark highlighter bookmarklet`
|
||||||
|
- `fix: correct regex in search bookmarklet`
|
||||||
|
|
||||||
|
## Special Considerations
|
||||||
|
|
||||||
|
### Cross-Linking
|
||||||
|
|
||||||
|
When suggesting note connections:
|
||||||
|
|
||||||
|
- Look for conceptual relationships
|
||||||
|
- Suggest bidirectional links
|
||||||
|
- Consider creating index notes for related topics
|
||||||
|
|
||||||
|
### Code Reusability
|
||||||
|
|
||||||
|
- Create templates in `/code/templates/` for common patterns
|
||||||
|
- Extract reusable functions into utility modules
|
||||||
|
- Document APIs and interfaces
|
||||||
|
|
||||||
|
### Search & Discovery
|
||||||
|
|
||||||
|
- Use descriptive titles and headers
|
||||||
|
- Include relevant tags in frontmatter
|
||||||
|
- Add aliases for alternative terms
|
||||||
|
- Consider TODO tags: `TODO:`, `FIXME:`, `NOTE:`, `IDEA:`
|
||||||
|
|
||||||
|
## Preferences
|
||||||
|
|
||||||
|
- **Brevity**: Favor concise, clear explanations
|
||||||
|
- **Examples**: Include practical examples in code
|
||||||
|
- **Context**: Assume this is a personal knowledge workspace
|
||||||
|
- **Flexibility**: This is a scratchpad - prioritize exploration over perfection
|
||||||
|
- **Learning**: Explain concepts when introducing new patterns or techniques
|
||||||
|
|
||||||
|
## README Maintenance
|
||||||
|
|
||||||
|
**IMPORTANT**: Keep README files synchronized with project structure changes.
|
||||||
|
|
||||||
|
### When to Update READMEs
|
||||||
|
|
||||||
|
Update relevant README.md files whenever you:
|
||||||
|
|
||||||
|
- Add or remove folders
|
||||||
|
- Change file organization
|
||||||
|
- Add new tools or utilities
|
||||||
|
- Modify workflows or conventions
|
||||||
|
- Add new features or capabilities
|
||||||
|
|
||||||
|
### README Locations
|
||||||
|
|
||||||
|
- `/README.md` - Main project overview and quick start
|
||||||
|
- `/docs/README.md` - Documentation hub and note-taking guide
|
||||||
|
- `/code/README.md` - Code section overview
|
||||||
|
- `/code/bookmarklets/README.md` - Bookmarklet creation guide
|
||||||
|
- `/.github/README.md` - GitHub templates and structure
|
||||||
|
|
||||||
|
### Update Guidelines
|
||||||
|
|
||||||
|
- Keep structure diagrams accurate
|
||||||
|
- Update examples to reflect current patterns
|
||||||
|
- Maintain consistency across all READMEs
|
||||||
|
- Add new sections before implementation when adding major features
|
||||||
|
- Remove outdated information immediately
|
||||||
|
|
||||||
|
## Tools & Extensions Available
|
||||||
|
|
||||||
|
- Foam (wiki-links, backlinks, graph)
|
||||||
|
- Code Runner (quick code execution)
|
||||||
|
- Todo Tree (tracks TODO comments)
|
||||||
|
- Bookmarks (mark important code locations)
|
||||||
|
- ESLint (JavaScript linting)
|
||||||
38
.gitignore
vendored
Normal file
38
.gitignore
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# Operating System
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Editor
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*~
|
||||||
|
|
||||||
|
# Node
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
|
# Python
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
.Python
|
||||||
|
*.so
|
||||||
|
.venv/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Temporary files
|
||||||
|
*.tmp
|
||||||
|
.temp/
|
||||||
|
temp/
|
||||||
|
|
||||||
|
# Personal
|
||||||
|
docs/fleeting/*.md
|
||||||
|
!docs/fleeting/README.md
|
||||||
11
.vscode/extensions.json
vendored
Normal file
11
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"foam.foam-vscode",
|
||||||
|
"yzhang.markdown-all-in-one",
|
||||||
|
"kortina.vscode-markdown-notes",
|
||||||
|
"gruntfuggly.todo-tree",
|
||||||
|
"formulahendry.code-runner",
|
||||||
|
"alefragnani.bookmarks",
|
||||||
|
"alefragnani.project-manager"
|
||||||
|
]
|
||||||
|
}
|
||||||
98
.vscode/settings.json
vendored
Normal file
98
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
{
|
||||||
|
// Foam Configuration
|
||||||
|
"foam.openDailyNote.directory": "docs/daily",
|
||||||
|
"foam.openDailyNote.filenameFormat": "'daily-'yyyy-MM-dd",
|
||||||
|
"foam.files.ignore": [
|
||||||
|
"**/node_modules/**",
|
||||||
|
"**/code/**/*.js",
|
||||||
|
"**/code/**/*.py",
|
||||||
|
"**/code/**/*.ts"
|
||||||
|
],
|
||||||
|
|
||||||
|
// Markdown Configuration
|
||||||
|
"markdown.extension.toc.levels": "2..6",
|
||||||
|
"markdown.extension.completion.root": "./docs",
|
||||||
|
"markdown.extension.preview.autoShowPreviewToSide": true,
|
||||||
|
|
||||||
|
// Markdown Notes Configuration
|
||||||
|
"vscodeMarkdownNotes.noteCompletionConvention": "[[wiki-link]]",
|
||||||
|
"vscodeMarkdownNotes.slugifyMethod": "github-slug",
|
||||||
|
"vscodeMarkdownNotes.workspaceFilenameConvention": "uniqueFilenames",
|
||||||
|
|
||||||
|
// Todo Tree Configuration
|
||||||
|
"todo-tree.general.tags": [
|
||||||
|
"TODO",
|
||||||
|
"FIXME",
|
||||||
|
"NOTE",
|
||||||
|
"IDEA",
|
||||||
|
"HACK",
|
||||||
|
"QUESTION"
|
||||||
|
],
|
||||||
|
"todo-tree.highlights.defaultHighlight": {
|
||||||
|
"icon": "check",
|
||||||
|
"type": "text",
|
||||||
|
"foreground": "white",
|
||||||
|
"background": "green",
|
||||||
|
"opacity": 50
|
||||||
|
},
|
||||||
|
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^[ \\t]*(-|\\d+.))\\s*($TAGS)",
|
||||||
|
|
||||||
|
// Code Runner Configuration
|
||||||
|
"code-runner.clearPreviousOutput": true,
|
||||||
|
"code-runner.showExecutionMessage": true,
|
||||||
|
"code-runner.saveFileBeforeRun": true,
|
||||||
|
"code-runner.runInTerminal": true,
|
||||||
|
"code-runner.executorMap": {
|
||||||
|
"javascript": "node",
|
||||||
|
"python": "python3",
|
||||||
|
"typescript": "ts-node"
|
||||||
|
},
|
||||||
|
|
||||||
|
// File Associations
|
||||||
|
"files.associations": {
|
||||||
|
"*.md": "markdown"
|
||||||
|
},
|
||||||
|
|
||||||
|
// Search Configuration
|
||||||
|
"search.exclude": {
|
||||||
|
"**/node_modules": true,
|
||||||
|
"**/bower_components": true,
|
||||||
|
"**/*.code-search": true,
|
||||||
|
"**/docs/assets/**": true
|
||||||
|
},
|
||||||
|
|
||||||
|
// Auto Save
|
||||||
|
"files.autoSave": "afterDelay",
|
||||||
|
"files.autoSaveDelay": 1000,
|
||||||
|
|
||||||
|
// Editor Configuration for Markdown
|
||||||
|
"[markdown]": {
|
||||||
|
"editor.wordWrap": "on",
|
||||||
|
"editor.quickSuggestions": {
|
||||||
|
"comments": "on",
|
||||||
|
"strings": "on",
|
||||||
|
"other": "on"
|
||||||
|
},
|
||||||
|
"editor.snippetSuggestions": "top",
|
||||||
|
"editor.formatOnSave": true
|
||||||
|
},
|
||||||
|
|
||||||
|
// Bookmarks Configuration
|
||||||
|
"bookmarks.saveBookmarksInProject": true,
|
||||||
|
"bookmarks.navigateThroughAllFiles": true,
|
||||||
|
|
||||||
|
// GitDoc Configuration - Auto-commit on save
|
||||||
|
"gitdoc.enabled": true,
|
||||||
|
"gitdoc.autoCommitDelay": 1000,
|
||||||
|
"gitdoc.commitMessageFormat": "docs: ${message}",
|
||||||
|
"gitdoc.commitValidationLevel": "none",
|
||||||
|
"gitdoc.autoPush": "off",
|
||||||
|
|
||||||
|
// ESLint Configuration
|
||||||
|
"eslint.validate": [
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact"
|
||||||
|
]
|
||||||
|
}
|
||||||
113
README.md
Normal file
113
README.md
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
# Memory Palace
|
||||||
|
|
||||||
|
A hybrid workspace combining Obsidian-style knowledge management with code development.
|
||||||
|
|
||||||
|
## 📁 Structure
|
||||||
|
|
||||||
|
### Documentation (`/docs`)
|
||||||
|
|
||||||
|
- **daily/** - Daily notes and journal entries
|
||||||
|
- **projects/** - Project-specific documentation
|
||||||
|
- **concepts/** - Evergreen notes and core concepts
|
||||||
|
- **fleeting/** - Quick captures and temporary notes
|
||||||
|
- **assets/** - Images, diagrams, and attachments
|
||||||
|
|
||||||
|
### Code (`/code`)
|
||||||
|
|
||||||
|
- **bookmarklets/** - Browser bookmarklets and utilities
|
||||||
|
- **scratchpad/** - Experimental code organized by language
|
||||||
|
- python/
|
||||||
|
- javascript/
|
||||||
|
- typescript/
|
||||||
|
- **templates/** - Reusable code templates
|
||||||
|
- **utils/** - Build tools and generators (bookmarklet maker, etc.)
|
||||||
|
|
||||||
|
## 🚀 Getting Started
|
||||||
|
|
||||||
|
### Creating Notes
|
||||||
|
|
||||||
|
- Press `Cmd+Shift+P` and type "Foam: Create New Note" to create a linked note
|
||||||
|
- Use `[[wiki-style links]]` to connect notes
|
||||||
|
- Daily notes: "Foam: Open Daily Note"
|
||||||
|
|
||||||
|
### Linking Notes
|
||||||
|
|
||||||
|
- Type `[[` to search and link to other notes
|
||||||
|
- Right-click on a note to see backlinks
|
||||||
|
- Use the graph view to visualize connections
|
||||||
|
|
||||||
|
### Writing Code
|
||||||
|
|
||||||
|
- Navigate to `/code` folders for development
|
||||||
|
- Use `Cmd+Shift+P` → "Code Runner: Run Code" to execute scripts
|
||||||
|
- Bookmarks extension: `Cmd+Alt+K` to toggle bookmarks
|
||||||
|
|
||||||
|
## 📚 Key Features
|
||||||
|
|
||||||
|
### Documentation Features
|
||||||
|
|
||||||
|
- **Wiki-style linking** - Connect ideas with `[[links]]`
|
||||||
|
- **Backlinks** - See which notes reference the current note
|
||||||
|
- **Graph visualization** - Visual map of your knowledge
|
||||||
|
- **Daily notes** - Automatic daily note creation
|
||||||
|
|
||||||
|
### Code Features
|
||||||
|
|
||||||
|
- **Multi-language support** - Python, JavaScript, TypeScript
|
||||||
|
- **Quick execution** - Run code snippets instantly
|
||||||
|
- **Code bookmarks** - Mark important code sections
|
||||||
|
- **Todo tracking** - Track TODOs across all files
|
||||||
|
|
||||||
|
## 🎯 Useful Commands
|
||||||
|
|
||||||
|
| Command | Shortcut | Description |
|
||||||
|
| --------------- | ---------- | ------------------------- |
|
||||||
|
| Create New Note | - | Foam: Create New Note |
|
||||||
|
| Open Daily Note | - | Foam: Open Daily Note |
|
||||||
|
| Show Graph | - | Foam: Show Graph |
|
||||||
|
| Run Code | Ctrl+Alt+N | Execute current file |
|
||||||
|
| Toggle Bookmark | Cmd+Alt+K | Mark/unmark code location |
|
||||||
|
| Show Todos | - | Todo Tree: Focus on View |
|
||||||
|
|
||||||
|
## 🔍 Search Tips
|
||||||
|
|
||||||
|
- Use `Cmd+P` for quick file navigation
|
||||||
|
- `Cmd+Shift+F` for workspace-wide search
|
||||||
|
- Todo Tree automatically finds TODO, FIXME, NOTE, IDEA tags
|
||||||
|
|
||||||
|
## 📝 Note-Taking Tips
|
||||||
|
|
||||||
|
1. Use descriptive filenames (automatically slugified)
|
||||||
|
2. Start with fleeting notes, refine into concepts
|
||||||
|
3. Link liberally - connections create value
|
||||||
|
4. Review backlinks regularly to discover patterns
|
||||||
|
|
||||||
|
## 💡 Bookmarklet Development
|
||||||
|
|
||||||
|
1. Write bookmarklets as regular JavaScript in `/code/bookmarklets/`
|
||||||
|
2. Run `npm run bookmarklet -- code/bookmarklets/your-file.js`
|
||||||
|
3. Generator removes comments, minifies, and copies to clipboard
|
||||||
|
4. Paste into browser bookmark URL field
|
||||||
|
|
||||||
|
See [code/bookmarklets/README.md](code/bookmarklets/README.md) for detailed instructions.
|
||||||
|
|
||||||
|
## 🔧 Customization
|
||||||
|
|
||||||
|
Edit `.vscode/settings.json` to customize:
|
||||||
|
|
||||||
|
- Daily note location and format
|
||||||
|
- Todo tags and highlighting
|
||||||
|
- Code execution behavior
|
||||||
|
- Search exclusions
|
||||||
|
|
||||||
|
## 📦 Module System
|
||||||
|
|
||||||
|
This project uses **ES modules** (import/export), not CommonJS (require):
|
||||||
|
|
||||||
|
- `package.json` is configured with `"type": "module"`
|
||||||
|
- Use `import` and `export` statements in all JavaScript files
|
||||||
|
- See [code/templates/](code/templates/) for examples
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
_Start exploring by creating your first note or diving into the code folders!_
|
||||||
78
code/README.md
Normal file
78
code/README.md
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
# Code Section
|
||||||
|
|
||||||
|
Development workspace for bookmarklets, experiments, and scratch code.
|
||||||
|
|
||||||
|
## 🔖 Bookmarklets
|
||||||
|
|
||||||
|
Browser-based JavaScript utilities. **See [bookmarklets/README.md](bookmarklets/README.md) for full documentation.**
|
||||||
|
|
||||||
|
### Quick Start
|
||||||
|
|
||||||
|
1. Write regular JavaScript in `bookmarklets/` (use comments, modern syntax)
|
||||||
|
2. Run: `npm run bookmarklet -- code/bookmarklets/your-file.js`
|
||||||
|
3. Paste clipboard contents into browser bookmark URL
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
/**
|
||||||
|
* My Bookmarklet
|
||||||
|
* Does something cool
|
||||||
|
*/
|
||||||
|
|
||||||
|
const elements = document.querySelectorAll("a");
|
||||||
|
elements.forEach((el) => {
|
||||||
|
el.style.backgroundColor = "yellow";
|
||||||
|
});
|
||||||
|
|
||||||
|
alert(`Highlighted ${elements.length} links!`);
|
||||||
|
```
|
||||||
|
|
||||||
|
The generator automatically removes comments, minifies, and wraps in IIFE format.
|
||||||
|
|
||||||
|
## 🛠️ Utils
|
||||||
|
|
||||||
|
Build tools and generators:
|
||||||
|
|
||||||
|
- **bookmarkletMaker.js** - Converts JS files to bookmarklets
|
||||||
|
- Removes comments
|
||||||
|
- Minifies code
|
||||||
|
- Wraps in `javascript:(function(){...})();` format
|
||||||
|
- Copies to clipboard
|
||||||
|
|
||||||
|
## 🧪 Scratchpad
|
||||||
|
|
||||||
|
Experiment with code organized by language. Use this for:
|
||||||
|
|
||||||
|
- Testing new ideas
|
||||||
|
- Prototyping features
|
||||||
|
- Learning new concepts
|
||||||
|
- Code snippets for other projects
|
||||||
|
|
||||||
|
### Running Code
|
||||||
|
|
||||||
|
- **Python:** `Cmd+Shift+P` → "Code Runner: Run Code"
|
||||||
|
- **JavaScript:** Same as above (uses Node.js)
|
||||||
|
- **TypeScript:** Install `ts-node` globally first
|
||||||
|
|
||||||
|
## 📄 Templates
|
||||||
|
|
||||||
|
Reusable code templates and boilerplate:
|
||||||
|
|
||||||
|
- **function-template.js** - Function with ES module exports
|
||||||
|
- **class-template.js** - Class definition with methods
|
||||||
|
- **module-template.js** - Multi-export module pattern
|
||||||
|
- Common patterns and structures
|
||||||
|
|
||||||
|
**Note:** All templates use ES modules (import/export). See `package.json` with `"type": "module"`.
|
||||||
|
|
||||||
|
## 💡 Tips
|
||||||
|
|
||||||
|
- Use `// TODO:` comments for tracking work
|
||||||
|
- Bookmark important code sections
|
||||||
|
- Test in scratchpad before moving to bookmarklets
|
||||||
|
- Keep snippets small and focused
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Remember:** This is your experimental playground. Break things, learn, iterate!
|
||||||
142
code/bookmarklets/README.md
Normal file
142
code/bookmarklets/README.md
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
# Bookmarklets
|
||||||
|
|
||||||
|
Browser-based JavaScript utilities that run with a single click from your bookmarks bar.
|
||||||
|
|
||||||
|
## 🚀 Creating a Bookmarklet
|
||||||
|
|
||||||
|
### 1. Write Your JavaScript
|
||||||
|
|
||||||
|
Create a new `.js` file in this directory with regular, readable JavaScript:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
/**
|
||||||
|
* My Awesome Bookmarklet
|
||||||
|
* Does something cool on any webpage
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Your code here
|
||||||
|
const elements = document.querySelectorAll(".some-class");
|
||||||
|
elements.forEach((el) => {
|
||||||
|
// Do something
|
||||||
|
});
|
||||||
|
|
||||||
|
alert("Done!");
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Generate the Bookmarklet
|
||||||
|
|
||||||
|
Run the generator:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run bookmarklet -- code/bookmarklets/your-file.js
|
||||||
|
```
|
||||||
|
|
||||||
|
The generator will:
|
||||||
|
|
||||||
|
- ✂️ Remove all comments
|
||||||
|
- 🗜️ Minify the code
|
||||||
|
- 📦 Wrap in bookmarklet format
|
||||||
|
- 📋 Copy to your clipboard
|
||||||
|
|
||||||
|
### 3. Install in Browser
|
||||||
|
|
||||||
|
1. Create a new bookmark (Cmd+D or Ctrl+D)
|
||||||
|
2. Paste the clipboard content as the URL
|
||||||
|
3. Name it and save
|
||||||
|
4. Click to use!
|
||||||
|
|
||||||
|
## 📚 Available Bookmarklets
|
||||||
|
|
||||||
|
### [highlight-links.js](highlight-links.js)
|
||||||
|
|
||||||
|
Highlights all links on a page in yellow and shows count.
|
||||||
|
|
||||||
|
**Generate:** `npm run bookmarklet -- code/bookmarklets/highlight-links.js`
|
||||||
|
|
||||||
|
### [example-bookmarklet.js](example-bookmarklet.js)
|
||||||
|
|
||||||
|
Example template showing basic structure.
|
||||||
|
|
||||||
|
## 💡 Tips
|
||||||
|
|
||||||
|
- **Test first**: Try your logic in the browser console before creating bookmarklet
|
||||||
|
- **Be browser-safe**: Stick to vanilla JS, avoid ES6+ features in production if supporting old browsers
|
||||||
|
- **Keep it simple**: Bookmarklets should be quick utilities, not full apps
|
||||||
|
- **Comment generously**: Comments are stripped out, so explain your code
|
||||||
|
- **Use descriptive names**: Variables and functions will be minified
|
||||||
|
|
||||||
|
## 🔧 Bookmarklet Generator
|
||||||
|
|
||||||
|
The generator ([code/utils/bookmarkletMaker.js](../utils/bookmarkletMaker.js)) handles:
|
||||||
|
|
||||||
|
- Comment removal (single-line `//` and multi-line `/* */`)
|
||||||
|
- Code minification (whitespace removal, single-line conversion)
|
||||||
|
- IIFE wrapping with `javascript:` protocol
|
||||||
|
- Clipboard copying
|
||||||
|
|
||||||
|
## 📝 Common Patterns
|
||||||
|
|
||||||
|
### Getting Page Info
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Current URL
|
||||||
|
const url = window.location.href;
|
||||||
|
|
||||||
|
// Page title
|
||||||
|
const title = document.title;
|
||||||
|
|
||||||
|
// Selected text
|
||||||
|
const selected = window.getSelection().toString();
|
||||||
|
```
|
||||||
|
|
||||||
|
### Modifying the Page
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Find elements
|
||||||
|
const elements = document.querySelectorAll(".selector");
|
||||||
|
|
||||||
|
// Style them
|
||||||
|
elements.forEach((el) => {
|
||||||
|
el.style.backgroundColor = "yellow";
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add content
|
||||||
|
const div = document.createElement("div");
|
||||||
|
div.textContent = "Hello!";
|
||||||
|
document.body.appendChild(div);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Opening New Windows
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Open in new tab
|
||||||
|
window.open("https://example.com", "_blank");
|
||||||
|
|
||||||
|
// With specific size
|
||||||
|
window.open("https://example.com", "_blank", "width=800,height=600");
|
||||||
|
```
|
||||||
|
|
||||||
|
### Copying to Clipboard
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
navigator.clipboard
|
||||||
|
.writeText("text to copy")
|
||||||
|
.then(() => alert("Copied!"))
|
||||||
|
.catch((err) => alert("Failed: " + err));
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🐛 Debugging
|
||||||
|
|
||||||
|
If your bookmarklet doesn't work:
|
||||||
|
|
||||||
|
1. Open browser console (F12)
|
||||||
|
2. Paste your original code (without `javascript:` wrapper)
|
||||||
|
3. Debug errors
|
||||||
|
4. Update the source file
|
||||||
|
5. Regenerate bookmarklet
|
||||||
|
|
||||||
|
## 🔗 Resources
|
||||||
|
|
||||||
|
- [Bookmarklet Best Practices](https://en.wikipedia.org/wiki/Bookmarklet)
|
||||||
|
- [MDN: DOM API](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)
|
||||||
|
- [Browser Compatibility](https://caniuse.com/)
|
||||||
30
code/bookmarklets/example-bookmarklet.js
Normal file
30
code/bookmarklets/example-bookmarklet.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/**
|
||||||
|
* Example Bookmarklet Template
|
||||||
|
*
|
||||||
|
* This is a template for creating browser bookmarklets.
|
||||||
|
* To use: Wrap in javascript: protocol and minify
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
// Example: Highlight all links on a page
|
||||||
|
const links = document.querySelectorAll("a");
|
||||||
|
links.forEach((link) => {
|
||||||
|
link.style.backgroundColor = "yellow";
|
||||||
|
link.style.padding = "2px";
|
||||||
|
});
|
||||||
|
|
||||||
|
// Show confirmation
|
||||||
|
alert(`Highlighted ${links.length} links!`);
|
||||||
|
})();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To convert to bookmarklet:
|
||||||
|
* 1. Minify the code
|
||||||
|
* 2. Wrap in: javascript:(function(){YOUR_MINIFIED_CODE})();
|
||||||
|
* 3. Add to browser bookmarks
|
||||||
|
*
|
||||||
|
* Example bookmarklet format:
|
||||||
|
* javascript:(function(){'use strict';const links=document.querySelectorAll('a');links.forEach(link=>{link.style.backgroundColor='yellow';});alert(`Highlighted ${links.length} links!`);})();
|
||||||
|
*/
|
||||||
23
code/bookmarklets/highlight-links.js
Normal file
23
code/bookmarklets/highlight-links.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Highlight Links Bookmarklet
|
||||||
|
*
|
||||||
|
* Highlights all links on the current page with a yellow background
|
||||||
|
* and displays a count of total links found.
|
||||||
|
*
|
||||||
|
* Usage: Click the bookmarklet on any webpage
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Find all anchor tags
|
||||||
|
const links = document.querySelectorAll("a");
|
||||||
|
|
||||||
|
// Style each link
|
||||||
|
links.forEach((link) => {
|
||||||
|
link.style.backgroundColor = "yellow";
|
||||||
|
link.style.padding = "2px 4px";
|
||||||
|
link.style.borderRadius = "3px";
|
||||||
|
});
|
||||||
|
|
||||||
|
// Show result
|
||||||
|
alert(
|
||||||
|
`Highlighted ${links.length} link${links.length !== 1 ? "s" : ""} on this page!`,
|
||||||
|
);
|
||||||
110
code/bookmarklets/play-international-championships-dates.js
Normal file
110
code/bookmarklets/play-international-championships-dates.js
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
/*
|
||||||
|
* This script extracts event data from a table on a webpage and generates an iCalendar (.ics) file for download.
|
||||||
|
* It looks for a table with specific headers ('event', 'date', 'venue', 'address'), parses the event details,
|
||||||
|
* and then creates an iCalendar file with the extracted event information. The file is then automatically
|
||||||
|
* downloaded to the user's device.
|
||||||
|
*/
|
||||||
|
javascript: (() => {
|
||||||
|
function extractEventData() {
|
||||||
|
let tables = document.querySelectorAll('table');
|
||||||
|
if (tables.length > 1) {
|
||||||
|
tables = [tables[0]];
|
||||||
|
}
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
tables.forEach(table => {
|
||||||
|
const headers = [];
|
||||||
|
const rows = table.querySelectorAll('tr');
|
||||||
|
|
||||||
|
const firstRow = rows[0];
|
||||||
|
firstRow.querySelectorAll('td').forEach(td => {
|
||||||
|
headers.push(td.textContent.trim().toLowerCase());
|
||||||
|
});
|
||||||
|
|
||||||
|
if (
|
||||||
|
headers.includes('event') &&
|
||||||
|
headers.includes('date') &&
|
||||||
|
headers.includes('venue') &&
|
||||||
|
headers.includes('address')
|
||||||
|
) {
|
||||||
|
Array.from(rows)
|
||||||
|
.slice(1)
|
||||||
|
.forEach(row => {
|
||||||
|
const cells = row.querySelectorAll('td');
|
||||||
|
const rowData = {};
|
||||||
|
|
||||||
|
cells.forEach((cell, j) => {
|
||||||
|
const header = headers[j];
|
||||||
|
let cellText = cell.innerHTML
|
||||||
|
.replace(/<br\s*\/?>/gi, ', ')
|
||||||
|
.trim();
|
||||||
|
cellText = cellText.replace(/<\/?[^>]+(>|$)/g, '').trim();
|
||||||
|
|
||||||
|
if (header === 'event') {
|
||||||
|
rowData.event = cellText;
|
||||||
|
} else if (header === 'date') {
|
||||||
|
const month = cellText.split(' ')[0];
|
||||||
|
const year = cellText.split(',')[1].trim();
|
||||||
|
const startDay = cellText
|
||||||
|
.split(' ')[1]
|
||||||
|
.split(cellText.includes(' – ') ? ' – ' : '–')[0]
|
||||||
|
.trim();
|
||||||
|
const endDay = cellText
|
||||||
|
.split(cellText.includes(' – ') ? ' – ' : '–')[1]
|
||||||
|
.split(',')[0]
|
||||||
|
.trim();
|
||||||
|
rowData.startDate = `${month} ${startDay}, ${year}`;
|
||||||
|
rowData.endDate = `${month} ${endDay}, ${year}`;
|
||||||
|
} else if (header === 'venue') {
|
||||||
|
rowData.venue = cellText;
|
||||||
|
} else if (header === 'location') {
|
||||||
|
rowData.address = cellText;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log(data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = extractEventData();
|
||||||
|
|
||||||
|
function createICal(events) {
|
||||||
|
let icalContent =
|
||||||
|
'BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//FragginWagon//International-Championships\n';
|
||||||
|
|
||||||
|
events.forEach(event => {
|
||||||
|
icalContent += 'BEGIN:VEVENT\n';
|
||||||
|
icalContent += `DTSTART:${new Date(event.startDate).toISOString().replace(/[-:]/g, '').split('.')[0]}Z\n`;
|
||||||
|
icalContent += `DTEND:${new Date(event.endDate).toISOString().replace(/[-:]/g, '').split('.')[0]}Z\n`;
|
||||||
|
icalContent += `SUMMARY:${event.event} \n`;
|
||||||
|
icalContent += `LOCATION:${event.location}\n`;
|
||||||
|
icalContent += 'END:VEVENT\n';
|
||||||
|
});
|
||||||
|
|
||||||
|
icalContent += 'END:VCALENDAR';
|
||||||
|
|
||||||
|
return icalContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
function downloadICal(content, filename) {
|
||||||
|
const blob = new Blob([content], { type: 'text/calendar' });
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = url;
|
||||||
|
a.download = filename;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
document.body.removeChild(a);
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
const newIcalContent = createICal(data);
|
||||||
|
downloadICal(
|
||||||
|
newIcalContent,
|
||||||
|
'play_pokemon_international_championships_events.ics'
|
||||||
|
);
|
||||||
|
})();
|
||||||
117
code/bookmarklets/play-regional-special-dates.js
Normal file
117
code/bookmarklets/play-regional-special-dates.js
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This bookmarklet extracts event data from the first four tables on a webpage,
|
||||||
|
* specifically looking for tables that contain 'date', 'venue', and 'location' headers.
|
||||||
|
* It processes the event data to identify special events and formats the dates.
|
||||||
|
* The extracted data is then used to create an iCalendar (.ics) file, which is
|
||||||
|
* automatically downloaded to the user's device.
|
||||||
|
*
|
||||||
|
* Functions:
|
||||||
|
* - extractEventData: Extracts event data from the first four tables on the webpage.
|
||||||
|
* - createICal: Creates an iCalendar (.ics) content string from the extracted event data.
|
||||||
|
* - downloadICal: Initiates the download of the iCalendar (.ics) file with the given content and filename.
|
||||||
|
*/
|
||||||
|
javascript: (() => {
|
||||||
|
function extractEventData() {
|
||||||
|
let tables = document.querySelectorAll('table');
|
||||||
|
if (tables.length > 4) {
|
||||||
|
tables = Array.from(tables).slice(0, 4);
|
||||||
|
}
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
tables.forEach(table => {
|
||||||
|
const headers = [];
|
||||||
|
const rows = table.querySelectorAll('tr');
|
||||||
|
|
||||||
|
const firstRow = rows[0];
|
||||||
|
firstRow.querySelectorAll('td').forEach(td => {
|
||||||
|
headers.push(td.textContent.trim().toLowerCase());
|
||||||
|
});
|
||||||
|
|
||||||
|
if (
|
||||||
|
headers.includes('date') &&
|
||||||
|
headers.includes('venue') &&
|
||||||
|
headers.includes('location')
|
||||||
|
) {
|
||||||
|
Array.from(rows)
|
||||||
|
.slice(1)
|
||||||
|
.forEach(row => {
|
||||||
|
const cells = row.querySelectorAll('td');
|
||||||
|
const rowData = {};
|
||||||
|
|
||||||
|
if (
|
||||||
|
Array.from(cells).some(cell =>
|
||||||
|
cell.querySelector('span[style*="color: #2dc26b"]')
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
rowData.specialEvent = true;
|
||||||
|
}
|
||||||
|
cells.forEach((cell, j) => {
|
||||||
|
const header = headers[j];
|
||||||
|
let cellText = cell.innerHTML.replace(/<br\s*\/?>/gi, ', ').trim();
|
||||||
|
cellText = cellText.replace(/<\/?[^>]+(>|$)/g, '').trim();
|
||||||
|
|
||||||
|
if (header === 'date') {
|
||||||
|
const month = cellText.split(' ')[0];
|
||||||
|
const year = cellText.split(',')[1].trim();
|
||||||
|
const startDay = cellText
|
||||||
|
.split(' ')[1]
|
||||||
|
.split(cellText.includes(' – ') ? ' – ' : '–')[0]
|
||||||
|
.trim();
|
||||||
|
const endDay = cellText
|
||||||
|
.split(cellText.includes(' – ') ? ' – ' : '–')[1]
|
||||||
|
.split(',')[0]
|
||||||
|
.trim();
|
||||||
|
rowData.startDate = `${month} ${startDay}, ${year}`;
|
||||||
|
rowData.endDate = `${month} ${endDay}, ${year}`;
|
||||||
|
} else if (header === 'venue') {
|
||||||
|
rowData.venue = cellText;
|
||||||
|
} else if (header === 'location') {
|
||||||
|
rowData.location = cellText;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = extractEventData(tables);
|
||||||
|
|
||||||
|
function createICal(events) {
|
||||||
|
let icalContent =
|
||||||
|
'BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//FragginWagon//P!P //Regional-Special-Championships\n';
|
||||||
|
|
||||||
|
events.forEach(event => {
|
||||||
|
icalContent += 'BEGIN:VEVENT\n';
|
||||||
|
icalContent += `DTSTART:${new Date(event.startDate).toISOString().replace(/[-:]/g, '').split('.')[0]}Z\n`;
|
||||||
|
icalContent += `DTEND:${new Date(event.endDate).toISOString().replace(/[-:]/g, '').split('.')[0]}Z\n`;
|
||||||
|
icalContent += `SUMMARY:${event.specialEvent ? 'Special Event' : 'Regional'} - ${event.venue} \n`;
|
||||||
|
icalContent += `LOCATION:${event.location}\n`;
|
||||||
|
icalContent += 'END:VEVENT\n';
|
||||||
|
});
|
||||||
|
|
||||||
|
icalContent += 'END:VCALENDAR';
|
||||||
|
|
||||||
|
return icalContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
function downloadICal(content, filename) {
|
||||||
|
const blob = new Blob([content], { type: 'text/calendar' });
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = url;
|
||||||
|
a.download = filename;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
document.body.removeChild(a);
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
const newIcalContent = createICal(extractEventData());
|
||||||
|
downloadICal(newIcalContent, 'play_pokemon_regional_special_events.ics');
|
||||||
|
})();
|
||||||
125
code/junk-drawer/scrape.js
Normal file
125
code/junk-drawer/scrape.js
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
/**
|
||||||
|
* This script scrapes a website for table data using Puppeteer and Cheerio.
|
||||||
|
* It specifically looks for tables with headers "Date", "Venue", and "Location",
|
||||||
|
* and extracts the data from these tables.
|
||||||
|
*
|
||||||
|
* The script performs the following steps:
|
||||||
|
* 1. Launches a Puppeteer browser instance.
|
||||||
|
* 2. Sets the user agent and viewport to mimic a real browser.
|
||||||
|
* 3. Navigates to the specified URL.
|
||||||
|
* 4. Simulates human-like interactions (mouse movements and delays).
|
||||||
|
* 5. Extracts the HTML content of the page.
|
||||||
|
* 6. Loads the HTML content into Cheerio for parsing.
|
||||||
|
* 7. Finds all table elements and checks if they contain the headers "Date", "Venue", and "Location".
|
||||||
|
* 8. Extracts the data from the matching tables and returns it.
|
||||||
|
*
|
||||||
|
* @param {string} url - The URL of the website to scrape.
|
||||||
|
* @returns {Promise<Array<Object>>} - A promise that resolves to an array of objects containing the scraped data.
|
||||||
|
*
|
||||||
|
* Example usage:
|
||||||
|
* const url = 'https://www.pokemon.com/us/play-pokemon/pokemon-events/championship-series/2025/regional-special-championships';
|
||||||
|
* scrapeWebsite(url)
|
||||||
|
* .then(data => console.log(data))
|
||||||
|
* .catch(error => console.error(error));
|
||||||
|
*
|
||||||
|
* Required npm packages:
|
||||||
|
* - puppeteer: ^10.0.0
|
||||||
|
* - cheerio: ^1.0.0-rc.10
|
||||||
|
*
|
||||||
|
* Currently not working due to recaptch on P!P site
|
||||||
|
*/
|
||||||
|
const puppeteer = require("puppeteer");
|
||||||
|
const cheerio = require("cheerio");
|
||||||
|
|
||||||
|
async function scrapeWebsite(url) {
|
||||||
|
// Launch Puppeteer
|
||||||
|
const browser = await puppeteer.launch({
|
||||||
|
headless: false, // Run in headless mode
|
||||||
|
args: [
|
||||||
|
"--no-sandbox",
|
||||||
|
"--disable-setuid-sandbox",
|
||||||
|
"--disable-dev-shm-usage",
|
||||||
|
"--disable-accelerated-2d-canvas",
|
||||||
|
"--disable-gpu",
|
||||||
|
"--window-size=1920x1080",
|
||||||
|
],
|
||||||
|
});
|
||||||
|
const page = await browser.newPage();
|
||||||
|
// Set user agent to mimic a real browser
|
||||||
|
await page.setUserAgent(
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
||||||
|
);
|
||||||
|
|
||||||
|
// Set viewport to mimic a real browser
|
||||||
|
await page.setViewport({ width: 1920, height: 1080 });
|
||||||
|
|
||||||
|
// Navigate to the URL
|
||||||
|
await page.goto(url, { waitUntil: "networkidle2" });
|
||||||
|
|
||||||
|
// Simulate human-like interactions
|
||||||
|
await page.waitForTimeout(2000); // Wait for 2 seconds
|
||||||
|
await page.mouse.move(100, 100); // Move mouse to a specific position
|
||||||
|
await page.mouse.move(200, 200, { steps: 10 }); // Move mouse with steps
|
||||||
|
await page.waitForTimeout(1000); // Wait for 1 second
|
||||||
|
|
||||||
|
// Get the HTML content
|
||||||
|
const content = await page.content();
|
||||||
|
await browser.close();
|
||||||
|
|
||||||
|
// Load the HTML content into Cheerio
|
||||||
|
const $ = cheerio.load(content);
|
||||||
|
|
||||||
|
// Find all table elements
|
||||||
|
const tables = $("table");
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
// Loop through each table
|
||||||
|
tables.each((index, table) => {
|
||||||
|
const headers = [];
|
||||||
|
const rows = $(table).find("tr");
|
||||||
|
|
||||||
|
// Check if the first row contains the headers Date, Venue, and Location
|
||||||
|
const firstRow = rows.first();
|
||||||
|
firstRow.find("tr").each((i, th) => {
|
||||||
|
headers.push($(th).text().trim().toLowerCase());
|
||||||
|
});
|
||||||
|
|
||||||
|
if (
|
||||||
|
headers.includes("date") &&
|
||||||
|
headers.includes("venue") &&
|
||||||
|
headers.includes("location")
|
||||||
|
) {
|
||||||
|
// Loop through the remaining rows and extract data
|
||||||
|
rows.slice(1).each((i, row) => {
|
||||||
|
const cells = $(row).find("td");
|
||||||
|
const rowData = {};
|
||||||
|
|
||||||
|
cells.each((j, cell) => {
|
||||||
|
const header = headers[j];
|
||||||
|
const cellText = $(cell).text().trim();
|
||||||
|
|
||||||
|
if (header === "date") {
|
||||||
|
const dates = cellText.split(" - ");
|
||||||
|
rowData.startDate = dates[0];
|
||||||
|
rowData.endDate = dates[1] || dates[0];
|
||||||
|
} else if (header === "venue") {
|
||||||
|
rowData.venue = cellText;
|
||||||
|
} else if (header === "location") {
|
||||||
|
rowData.location = cellText;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Example usage
|
||||||
|
const url =
|
||||||
|
"https://www.pokemon.com/us/play-pokemon/pokemon-events/championship-series/2025/regional-special-championships";
|
||||||
|
scrapeWebsite(url)
|
||||||
|
.then((data) => console.log(data))
|
||||||
|
.catch((error) => console.error(error));
|
||||||
93173
code/junk-drawer/tts-copypasta-hall-of-fame.json
Normal file
93173
code/junk-drawer/tts-copypasta-hall-of-fame.json
Normal file
File diff suppressed because one or more lines are too long
26
code/scratchpad/javascript/example.js
Normal file
26
code/scratchpad/javascript/example.js
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
/**
|
||||||
|
* Example JavaScript scratchpad file
|
||||||
|
*
|
||||||
|
* Use this area to test JavaScript/Node.js code
|
||||||
|
* This project uses ES modules (import/export)
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Example imports (uncomment to use)
|
||||||
|
// import fs from 'fs';
|
||||||
|
// import path from 'path';
|
||||||
|
// import { someFunction } from './other-file.js';
|
||||||
|
|
||||||
|
function helloWorld() {
|
||||||
|
console.log("Hello from Memory Palace!");
|
||||||
|
return "Success";
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Add your experimental code here
|
||||||
|
|
||||||
|
// Run the example
|
||||||
|
const result = helloWorld();
|
||||||
|
console.log(`Result: ${result}`);
|
||||||
|
|
||||||
|
// Export for use in other modules
|
||||||
|
export { helloWorld };
|
||||||
|
export default helloWorld;
|
||||||
19
code/scratchpad/python/example.py
Normal file
19
code/scratchpad/python/example.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
Example Python scratchpad file
|
||||||
|
|
||||||
|
Use this area to test Python code, experiment with libraries,
|
||||||
|
or prototype features for other projects.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def hello_world():
|
||||||
|
"""Example function"""
|
||||||
|
print("Hello from Memory Palace!")
|
||||||
|
return "Success"
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: Add your experimental code here
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
result = hello_world()
|
||||||
|
print(f"Result: {result}")
|
||||||
43
code/templates/class-template.js
Normal file
43
code/templates/class-template.js
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/**
|
||||||
|
* Class Template
|
||||||
|
*
|
||||||
|
* @class ClassName
|
||||||
|
* @description Description of what this class does
|
||||||
|
*/
|
||||||
|
export class ClassName {
|
||||||
|
/**
|
||||||
|
* Create a new instance
|
||||||
|
* @param {type} param - Description
|
||||||
|
*/
|
||||||
|
constructor(param) {
|
||||||
|
this.param = param;
|
||||||
|
// TODO: Initialize properties
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
* @param {type} arg - Description
|
||||||
|
* @returns {type} Description
|
||||||
|
*/
|
||||||
|
methodName(arg) {
|
||||||
|
// TODO: Implement method logic
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static method example
|
||||||
|
* @param {type} arg - Description
|
||||||
|
* @returns {type} Description
|
||||||
|
*/
|
||||||
|
static staticMethod(arg) {
|
||||||
|
// TODO: Implement static method
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alternative export:
|
||||||
|
// export default ClassName;
|
||||||
|
|
||||||
|
// Usage example:
|
||||||
|
// import { ClassName } from './class-template.js';
|
||||||
|
// const instance = new ClassName(param);
|
||||||
16
code/templates/function-template.js
Normal file
16
code/templates/function-template.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Function Template
|
||||||
|
*
|
||||||
|
* @param {type} paramName - Description
|
||||||
|
* @returns {type} Description
|
||||||
|
*/
|
||||||
|
export function functionName(paramName) {
|
||||||
|
// TODO: Implement function logic
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alternative export styles:
|
||||||
|
// export default functionName; // Default export
|
||||||
|
// export { functionName }; // Named export
|
||||||
|
// export { functionName as myFunction }; // Renamed export
|
||||||
51
code/templates/module-template.js
Normal file
51
code/templates/module-template.js
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/**
|
||||||
|
* Module Template
|
||||||
|
*
|
||||||
|
* Example of a utility module with multiple exports
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function one
|
||||||
|
* @param {type} param - Description
|
||||||
|
* @returns {type} Description
|
||||||
|
*/
|
||||||
|
export function functionOne(param) {
|
||||||
|
// Implementation
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function two
|
||||||
|
* @param {type} param - Description
|
||||||
|
* @returns {type} Description
|
||||||
|
*/
|
||||||
|
export function functionTwo(param) {
|
||||||
|
// Implementation
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constant export
|
||||||
|
*/
|
||||||
|
export const CONSTANT_VALUE = "value";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object export
|
||||||
|
*/
|
||||||
|
export const config = {
|
||||||
|
option1: true,
|
||||||
|
option2: "value",
|
||||||
|
};
|
||||||
|
|
||||||
|
// Default export (optional)
|
||||||
|
export default {
|
||||||
|
functionOne,
|
||||||
|
functionTwo,
|
||||||
|
CONSTANT_VALUE,
|
||||||
|
config,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Usage examples:
|
||||||
|
// import { functionOne, functionTwo } from './module-template.js';
|
||||||
|
// import utils from './module-template.js'; // Default import
|
||||||
|
// import * as utils from './module-template.js'; // Namespace import
|
||||||
106
code/utils/bookmarkletMaker.js
Normal file
106
code/utils/bookmarkletMaker.js
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
/**
|
||||||
|
* Bookmarklet Generator
|
||||||
|
*
|
||||||
|
* Converts a regular JavaScript file into a bookmarklet format.
|
||||||
|
* - Removes all comments (single-line and multi-line)
|
||||||
|
* - Wraps code in IIFE for bookmarklet format
|
||||||
|
* - Minifies to a single line
|
||||||
|
* - Copies to clipboard
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* node code/utils/bookmarkletMaker.js <path-to-js-file>
|
||||||
|
* npm run bookmarklet -- <path-to-js-file>
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* npm run bookmarklet -- code/bookmarklets/example-bookmarklet.js
|
||||||
|
*/
|
||||||
|
import fs from "fs";
|
||||||
|
import path from "path";
|
||||||
|
import clipboardy from "clipboardy";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = path.dirname(__filename);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove all comments from JavaScript code
|
||||||
|
* @param {string} code - The JavaScript code
|
||||||
|
* @returns {string} Code without comments
|
||||||
|
*/
|
||||||
|
function removeComments(code) {
|
||||||
|
// Remove multi-line comments /* ... */
|
||||||
|
code = code.replace(/\/\*[\s\S]*?\*\//g, "");
|
||||||
|
// Remove single-line comments //
|
||||||
|
code = code.replace(/\/\/.*$/gm, "");
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minify code to a single line
|
||||||
|
* @param {string} code - The JavaScript code
|
||||||
|
* @returns {string} Minified code
|
||||||
|
*/
|
||||||
|
function minify(code) {
|
||||||
|
return code
|
||||||
|
.split("\n")
|
||||||
|
.map((line) => line.trim())
|
||||||
|
.filter((line) => line.length > 0)
|
||||||
|
.join(" ")
|
||||||
|
.replace(/\s+/g, " ")
|
||||||
|
.replace(/\s*([{}();,])\s*/g, "$1");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate bookmarklet from JavaScript file
|
||||||
|
* @param {string} filePath - Path to the JavaScript file
|
||||||
|
* @returns {string} The bookmarklet code
|
||||||
|
*/
|
||||||
|
function generateBookmarklet(filePath) {
|
||||||
|
// Validate file exists
|
||||||
|
if (!fs.existsSync(filePath)) {
|
||||||
|
throw new Error(`File not found: ${filePath}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read the JavaScript file
|
||||||
|
const jsCode = fs.readFileSync(filePath, "utf8");
|
||||||
|
|
||||||
|
// Clean and minify
|
||||||
|
let cleanedCode = removeComments(jsCode);
|
||||||
|
cleanedCode = minify(cleanedCode);
|
||||||
|
|
||||||
|
// Wrap in IIFE and add javascript: protocol
|
||||||
|
const bookmarklet = `javascript:(function(){${cleanedCode}})();`;
|
||||||
|
|
||||||
|
return bookmarklet;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main execution
|
||||||
|
try {
|
||||||
|
const filePath = process.argv[2];
|
||||||
|
|
||||||
|
if (!filePath) {
|
||||||
|
console.error("❌ Error: Please provide a file path");
|
||||||
|
console.log("\nUsage:");
|
||||||
|
console.log(" npm run bookmarklet -- <path-to-js-file>");
|
||||||
|
console.log("\nExample:");
|
||||||
|
console.log(" npm run bookmarklet -- code/bookmarklets/my-bookmarklet.js");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const bookmarklet = generateBookmarklet(filePath);
|
||||||
|
const fileName = path.basename(filePath);
|
||||||
|
|
||||||
|
// Copy to clipboard
|
||||||
|
clipboardy.writeSync(bookmarklet);
|
||||||
|
|
||||||
|
console.log("✅ Bookmarklet generated successfully!");
|
||||||
|
console.log(`📁 Source: ${fileName}`);
|
||||||
|
console.log(`📋 Copied to clipboard (${bookmarklet.length} characters)`);
|
||||||
|
console.log("\n📝 Next steps:");
|
||||||
|
console.log(" 1. Create a new bookmark in your browser");
|
||||||
|
console.log(" 2. Paste the clipboard content as the URL");
|
||||||
|
console.log(" 3. Give it a name and save");
|
||||||
|
} catch (error) {
|
||||||
|
console.error("❌ Error:", error.message);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
53
docs/README.md
Normal file
53
docs/README.md
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# Documentation Hub
|
||||||
|
|
||||||
|
Welcome to your knowledge base! This is your personal wiki for capturing ideas, projects, and concepts.
|
||||||
|
|
||||||
|
## 📖 How to Use
|
||||||
|
|
||||||
|
### Daily Notes
|
||||||
|
|
||||||
|
Capture thoughts, tasks, and reflections each day. These form the foundation of your memory palace.
|
||||||
|
|
||||||
|
**Quick Start:** Use "Foam: Open Daily Note" command
|
||||||
|
|
||||||
|
### Projects
|
||||||
|
|
||||||
|
Document ongoing projects, including goals, progress, and decisions.
|
||||||
|
|
||||||
|
### Concepts
|
||||||
|
|
||||||
|
Evergreen notes on core ideas, principles, and frameworks. These should be:
|
||||||
|
|
||||||
|
- Atomic (one concept per note)
|
||||||
|
- Concept-oriented (not task or project-specific)
|
||||||
|
- Densely linked
|
||||||
|
|
||||||
|
### Fleeting Notes
|
||||||
|
|
||||||
|
Quick captures that need to be processed later. Review regularly and:
|
||||||
|
|
||||||
|
- Elaborate into concept notes
|
||||||
|
- Move to project documentation
|
||||||
|
- Archive or delete
|
||||||
|
|
||||||
|
## 🔗 Linking Strategy
|
||||||
|
|
||||||
|
Use `[[wiki-links]]` to connect ideas:
|
||||||
|
|
||||||
|
- Link to related concepts
|
||||||
|
- Reference projects
|
||||||
|
- Connect daily notes
|
||||||
|
- Build a web of knowledge
|
||||||
|
|
||||||
|
## 📋 Templates
|
||||||
|
|
||||||
|
Create templates in your notes for consistency:
|
||||||
|
|
||||||
|
- Meeting notes
|
||||||
|
- Project kickoffs
|
||||||
|
- Book/article notes
|
||||||
|
- Decision logs
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Tip:** Start with fleeting notes, let patterns emerge, then organize into concepts and projects.
|
||||||
16
docs/fleeting/README.md
Normal file
16
docs/fleeting/README.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Fleeting Notes
|
||||||
|
|
||||||
|
Quick captures and temporary notes go here.
|
||||||
|
|
||||||
|
Use this folder for:
|
||||||
|
|
||||||
|
- Random thoughts
|
||||||
|
- Quick ideas
|
||||||
|
- Meeting jots
|
||||||
|
- Things to process later
|
||||||
|
|
||||||
|
**Tip:** Review this folder weekly and either:
|
||||||
|
|
||||||
|
- Elaborate into concept notes
|
||||||
|
- Move to project docs
|
||||||
|
- Archive or delete
|
||||||
0
docs/projects/README.md
Normal file
0
docs/projects/README.md
Normal file
56
docs/projects/paperlyte/README.md
Normal file
56
docs/projects/paperlyte/README.md
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
# Paperlyte Project
|
||||||
|
|
||||||
|
Documentation and development for Paperlyte-related projects and features.
|
||||||
|
|
||||||
|
## 📁 Project Structure
|
||||||
|
|
||||||
|
### [iPhone Media Playback When Plugged In](iPhone_Media_Playback_When_Plugged_In/)
|
||||||
|
|
||||||
|
iOS automation for switching media playback and volume when device is plugged in.
|
||||||
|
|
||||||
|
**Contents:**
|
||||||
|
|
||||||
|
- iOS Automation configuration
|
||||||
|
- iOS Shortcut setup for media bridge switching
|
||||||
|
- Volume control automation
|
||||||
|
|
||||||
|
**Status:** ⚙️ In Progress
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎯 About Paperlyte
|
||||||
|
|
||||||
|
<!-- Add project overview here -->
|
||||||
|
|
||||||
|
## 📋 Projects Overview
|
||||||
|
|
||||||
|
| Project | Status | Description |
|
||||||
|
| --------------------------------------------------------------- | -------------- | ------------------------------------------- |
|
||||||
|
| [iPhone Media Playback](iPhone_Media_Playback_When_Plugged_In/) | ⚙️ In Progress | Automated media switching on device plug-in |
|
||||||
|
|
||||||
|
## 🚀 Getting Started
|
||||||
|
|
||||||
|
<!-- Add general setup instructions for Paperlyte development -->
|
||||||
|
|
||||||
|
## 📝 Adding New Projects
|
||||||
|
|
||||||
|
When creating a new project folder:
|
||||||
|
|
||||||
|
1. Create folder in `/docs/projects/paperlyte/`
|
||||||
|
2. Add project README inside the folder
|
||||||
|
3. Update this README:
|
||||||
|
- Add folder to **Project Structure** section
|
||||||
|
- Add entry to **Projects Overview** table
|
||||||
|
- Update any relevant links or references
|
||||||
|
|
||||||
|
## 🔗 Related Resources
|
||||||
|
|
||||||
|
<!-- Add links to related documentation, repositories, tools, etc. -->
|
||||||
|
|
||||||
|
## 📅 Project Timeline
|
||||||
|
|
||||||
|
<!-- Track major milestones and deadlines -->
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Last Updated:** January 20, 2026
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
# iPhone Media Playback When Plugged In
|
||||||
|
|
||||||
|
iOS automation project for automatically switching media playback and adjusting volume when iPhone is plugged into power.
|
||||||
|
|
||||||
|
## 📸 Documentation
|
||||||
|
|
||||||
|
### iOS Automation Setup
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Configuration for iOS Automation that triggers when device is connected to power.
|
||||||
|
|
||||||
|
### iOS Shortcut
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Shortcut configuration that:
|
||||||
|
|
||||||
|
- Checks if audio bridge device is available/connected
|
||||||
|
- Switches media playback to audio bridge (if available)
|
||||||
|
- Sets volume to 100%
|
||||||
|
|
||||||
|
## 🎯 Purpose
|
||||||
|
|
||||||
|
Automatically configure iPhone media settings when plugged in for optimal audio playback through external speakers/bridge. Only switches output if the target device is physically connected and available.
|
||||||
|
|
||||||
|
## ⚙️ Setup
|
||||||
|
|
||||||
|
1. **Create iOS Shortcut:**
|
||||||
|
- Open Shortcuts app on iOS
|
||||||
|
- Create new shortcut with the following actions:
|
||||||
|
1. **Get Available Playback Destinations** (or **Get Audio Output**)
|
||||||
|
2. **If** [Playback Destinations] **contains** [Your Audio Bridge Name]
|
||||||
|
3. **Set Playback Destination** → Select your audio bridge
|
||||||
|
4. **Set Volume** → 100%
|
||||||
|
5. **End If**
|
||||||
|
- Name it appropriately (e.g., "Media Bridge Setup")
|
||||||
|
|
||||||
|
2. **Configure Automation:**
|
||||||
|
- Open Settings → Shortcuts → Automation
|
||||||
|
- Create new automation with "Charger" trigger
|
||||||
|
- Select "Is Connected" condition
|
||||||
|
- Add action to run the shortcut created above
|
||||||
|
- Disable "Ask Before Running" for automatic execution
|
||||||
|
|
||||||
|
## 🔧 Requirements
|
||||||
|
|
||||||
|
- iOS device
|
||||||
|
- Shortcuts app (built-in on iOS)
|
||||||
|
- Audio bridge/external speaker system
|
||||||
|
|
||||||
|
## <20> Shortcut Logic
|
||||||
|
|
||||||
|
```
|
||||||
|
Get Available Playback Destinations
|
||||||
|
IF [Playback Destinations] [contains] [Your Audio Bridge]
|
||||||
|
Set Playback Destination → [Your Audio Bridge]
|
||||||
|
Set Volume → 100%
|
||||||
|
END IF
|
||||||
|
```
|
||||||
|
|
||||||
|
**Alternative approach using text matching:**
|
||||||
|
|
||||||
|
```
|
||||||
|
Get Audio Output
|
||||||
|
Get Text from [Audio Output]
|
||||||
|
IF [Text] [contains] [Bridge Name]
|
||||||
|
Set Playback Destination → [Your Audio Bridge]
|
||||||
|
Set Volume → 100%
|
||||||
|
END IF
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📝 Notes
|
||||||
|
|
||||||
|
- Automation runs automatically when device is plugged in
|
||||||
|
- Shortcut checks for device availability before attempting to switch
|
||||||
|
- Volume is set to maximum (100%) - adjust in shortcut if needed
|
||||||
|
- If audio bridge is not available/connected, shortcut will do nothing (silent fail)
|
||||||
|
- Media output device name can be customized in the conditional check
|
||||||
|
- No error messages or notifications if device unavailable (prevents interruptions)
|
||||||
|
|
||||||
|
## 🚀 Future Enhancements
|
||||||
|
|
||||||
|
- [ ] Add volume level customization based on time of day
|
||||||
|
- [ ] Include notification when automation runs successfully
|
||||||
|
- [ ] Support for different audio devices based on location
|
||||||
|
- [ ] Add volume fade-in instead of instant 100%
|
||||||
|
- [x] Check device availability before switching (implemented)
|
||||||
|
- [ ] Add fallback device if primary bridge unavailable
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Status:** ⚙️ In Progress
|
||||||
|
**Last Updated:** January 20, 2026
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 270 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 301 KiB |
1400
package-lock.json
generated
Normal file
1400
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
23
package.json
Normal file
23
package.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"name": "memorypalace",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "A hybrid workspace combining Obsidian-style knowledge management with code development.",
|
||||||
|
"main": "index.js",
|
||||||
|
"directories": {
|
||||||
|
"doc": "docs"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"bookmarklet": "node code/utils/bookmarkletMaker.js"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "FragginWagon <greg.r.jacobs@gmail.com> (http://binarywasteland.com/)",
|
||||||
|
"license": "ISC",
|
||||||
|
"type": "module",
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^9.39.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"clipboardy": "^5.0.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user