Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
<li class="toctree-l1"><a class="reference internal" href="/.">Welcome to MkDocs</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/gems/">Gems, Snippets, and Concepts</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/license/">License</a>
</li>
Expand Down
128 changes: 128 additions & 0 deletions docs/gems/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="../img/favicon.ico" />
<title>Gems, Snippets, and Concepts - js2pysecrets</title>
<link rel="stylesheet" href="../css/theme.css" />
<link rel="stylesheet" href="../css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" />

<script>
// Current page data
var mkdocs_page_name = "Gems, Snippets, and Concepts";
var mkdocs_page_input_path = "gems.md";
var mkdocs_page_url = null;
</script>

<!--[if lt IE 9]>
<script src="../js/html5shiv.min.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</head>

<body class="wy-body-for-nav" role="document">

<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> js2pysecrets
</a><div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" title="Type search term here" />
</form>
</div>
</div>

<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul>
<li class="toctree-l1"><a class="reference internal" href="..">Welcome to MkDocs</a>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal current" href="./">Gems, Snippets, and Concepts</a>
<ul class="current">
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../license/">License</a>
</li>
</ul>
</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">js2pysecrets</a>

</nav>
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href=".." class="icon icon-home" aria-label="Docs"></a></li>
<li class="breadcrumb-item active">Gems, Snippets, and Concepts</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div class="section" itemprop="articleBody">

<h1 id="gems-snippets-and-concepts">Gems, Snippets, and Concepts</h1>
<p>Something about getting to a working Python and JavaScript interop will go here.</p>

</div>
</div><footer>
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation">
<a href=".." class="btn btn-neutral float-left" title="Welcome to MkDocs"><span class="icon icon-circle-arrow-left"></span> Previous</a>
<a href="../license/" class="btn btn-neutral float-right" title="License">Next <span class="icon icon-circle-arrow-right"></span></a>
</div>

<hr/>

<div role="contentinfo">
<!-- Copyright etc -->
</div>

Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>

</div>
</div>

</section>

</div>

<div class="rst-versions" role="note" aria-label="Versions">
<span class="rst-current-version" data-toggle="rst-current-version">


<span><a href=".." style="color: #fcfcfc">&laquo; Previous</a></span>


<span><a href="../license/" style="color: #fcfcfc">Next &raquo;</a></span>

</span>
</div>
<script src="../js/jquery-3.6.0.min.js"></script>
<script>var base_url = "..";</script>
<script src="../js/theme_extra.js"></script>
<script src="../js/theme.js"></script>
<script src="../search/main.js"></script>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
10 changes: 7 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="gems/">Gems, Snippets, and Concepts</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="license/">License</a>
</li>
Expand Down Expand Up @@ -100,7 +104,7 @@ <h2 id="project-layout">Project layout</h2>
</div>
</div><footer>
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation">
<a href="license/" class="btn btn-neutral float-right" title="License">Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="gems/" class="btn btn-neutral float-right" title="Gems, Snippets, and Concepts">Next <span class="icon icon-circle-arrow-right"></span></a>
</div>

<hr/>
Expand All @@ -124,7 +128,7 @@ <h2 id="project-layout">Project layout</h2>



<span><a href="license/" style="color: #fcfcfc">Next &raquo;</a></span>
<span><a href="gems/" style="color: #fcfcfc">Next &raquo;</a></span>

</span>
</div>
Expand All @@ -144,5 +148,5 @@ <h2 id="project-layout">Project layout</h2>

<!--
MkDocs version : 1.5.3
Build Date UTC : 2024-03-07 12:15:03.990808+00:00
Build Date UTC : 2024-03-07 14:29:50.215422+00:00
-->
8 changes: 6 additions & 2 deletions docs/license/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
<li class="toctree-l1"><a class="reference internal" href="..">Welcome to MkDocs</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../gems/">Gems, Snippets, and Concepts</a>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal current" href="./">License</a>
<ul class="current">
Expand Down Expand Up @@ -100,7 +104,7 @@ <h1 id="license">License</h1>
</div>
</div><footer>
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation">
<a href=".." class="btn btn-neutral float-left" title="Welcome to MkDocs"><span class="icon icon-circle-arrow-left"></span> Previous</a>
<a href="../gems/" class="btn btn-neutral float-left" title="Gems, Snippets, and Concepts"><span class="icon icon-circle-arrow-left"></span> Previous</a>
</div>

<hr/>
Expand All @@ -123,7 +127,7 @@ <h1 id="license">License</h1>
<span class="rst-current-version" data-toggle="rst-current-version">


<span><a href=".." style="color: #fcfcfc">&laquo; Previous</a></span>
<span><a href="../gems/" style="color: #fcfcfc">&laquo; Previous</a></span>


</span>
Expand Down
4 changes: 4 additions & 0 deletions docs/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
<li class="toctree-l1"><a class="reference internal" href="./.">Welcome to MkDocs</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="./gems/">Gems, Snippets, and Concepts</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="./license/">License</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion docs/search/search_index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Welcome to MkDocs For full documentation visit mkdocs.org . Commands mkdocs new [dir-name] - Create a new project. mkdocs serve - Start the live-reloading docs server. mkdocs build - Build the documentation site. mkdocs -h - Print help message and exit. mkdocs -h - Print help message and exit. Project layout mkdocs.yml # The configuration file. docs/ index.md # The documentation homepage. ... # Other markdown pages, images and other files.","title":"Welcome to MkDocs"},{"location":"#welcome-to-mkdocs","text":"For full documentation visit mkdocs.org .","title":"Welcome to MkDocs"},{"location":"#commands","text":"mkdocs new [dir-name] - Create a new project. mkdocs serve - Start the live-reloading docs server. mkdocs build - Build the documentation site. mkdocs -h - Print help message and exit. mkdocs -h - Print help message and exit.","title":"Commands"},{"location":"#project-layout","text":"mkdocs.yml # The configuration file. docs/ index.md # The documentation homepage. ... # Other markdown pages, images and other files.","title":"Project layout"},{"location":"license/","text":"License MIT License Copyright (c) 2024 INVITE Communications Co. Ltd. Copyright (c) 2024 Brian LaVallee <brian.lavallee@invite-comm.jp> 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.","title":"License"},{"location":"license/#license","text":"MIT License Copyright (c) 2024 INVITE Communications Co. Ltd. Copyright (c) 2024 Brian LaVallee <brian.lavallee@invite-comm.jp> 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.","title":"License"}]}
{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Welcome to MkDocs For full documentation visit mkdocs.org . Commands mkdocs new [dir-name] - Create a new project. mkdocs serve - Start the live-reloading docs server. mkdocs build - Build the documentation site. mkdocs -h - Print help message and exit. mkdocs -h - Print help message and exit. Project layout mkdocs.yml # The configuration file. docs/ index.md # The documentation homepage. ... # Other markdown pages, images and other files.","title":"Welcome to MkDocs"},{"location":"#welcome-to-mkdocs","text":"For full documentation visit mkdocs.org .","title":"Welcome to MkDocs"},{"location":"#commands","text":"mkdocs new [dir-name] - Create a new project. mkdocs serve - Start the live-reloading docs server. mkdocs build - Build the documentation site. mkdocs -h - Print help message and exit. mkdocs -h - Print help message and exit.","title":"Commands"},{"location":"#project-layout","text":"mkdocs.yml # The configuration file. docs/ index.md # The documentation homepage. ... # Other markdown pages, images and other files.","title":"Project layout"},{"location":"gems/","text":"Gems, Snippets, and Concepts Something about getting to a working Python and JavaScript interop will go here.","title":"Gems, Snippets, and Concepts"},{"location":"gems/#gems-snippets-and-concepts","text":"Something about getting to a working Python and JavaScript interop will go here.","title":"Gems, Snippets, and Concepts"},{"location":"license/","text":"License MIT License Copyright (c) 2024 INVITE Communications Co. Ltd. Copyright (c) 2024 Brian LaVallee <brian.lavallee@invite-comm.jp> 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.","title":"License"},{"location":"license/#license","text":"MIT License Copyright (c) 2024 INVITE Communications Co. Ltd. Copyright (c) 2024 Brian LaVallee <brian.lavallee@invite-comm.jp> 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.","title":"License"}]}
Binary file modified docs/sitemap.xml.gz
Binary file not shown.
3 changes: 3 additions & 0 deletions docs_source/gems.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Gems, Snippets, and Concepts

Something about getting to a working Python and JavaScript interop will go here.
29 changes: 29 additions & 0 deletions gems/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Gems Directory

Welcome to the "gems" directory! 🚀 Here, you'll find a collection of code snippets that serve as proof-of-concept (PoC) implementations. These snippets, while not directly used in the project, have been valuable in the development process. They've provided insights, solutions, or innovative approaches that have contributed to the overall success of the project.

## Purpose

- **Idea Exploration:** The snippets in this directory were created during the exploration phase, where various ideas and concepts were tested before implementation in the main project codebase.

- **Problem Solving:** These code snippets may contain solutions to specific challenges or problems encountered during development. While they might not be part of the final code, they showcase different approaches to problem-solving.

- **Learning and Experimentation:** The "gems" directory is also a space for experimentation and learning. Developers can refer to these PoCs to understand different techniques and methodologies.

## Organization

The directory is organized with each code snippet placed in a separate file or subdirectory, named descriptively to indicate its purpose or the problem it addresses. Additionally, a brief explanation is provided within each file to give context and insights into the PoC.

## How to Use

While the code in this directory is not directly integrated into the main project, you may find value in reviewing these snippets for reference or inspiration. If a particular PoC aligns with a current or future project requirement, feel free to adapt and incorporate the code into your work.

## Contributing

If you have additional PoCs or innovative code snippets that you believe could benefit the project, consider contributing them to this directory. Follow the contribution guidelines outlined in the project's main README.

## License

All code snippets in this directory are provided under the [project's license](https://github.com/poing/JS2PySecrets/blob/main/LICENSE). Please review the license before using or distributing any code from this directory.

Happy coding! 🎉
36 changes: 36 additions & 0 deletions gems/dict2json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set et sw=4 fenc=utf-8:
#
# dict2json.py

"""
This is a basic example of taking a Python dict and returning JSON.

The goal is passing function names and argument groups in a nested JSON.

It's a work in progress where the assumption is, there will be a set of setup commands (that are likely static), followed by a dynamic command with var based arguments.
"""

import json

# key: value (the function & arguments)
setup = [
{"function": "setRNG", "args": ["testRandom"]},
{"function": "init", "args": [12, 'testRandom']}
]

# Dynamic Values
foo = ["1234abc", 6, 3]

# key: value (the function & dynamic arguments)
main = {"function": "share", "args": foo}

# Combine setup and main
tasks = [{"setup": setup, "start": main}]

# Convert the Python dictionary to JSON
json_data = json.dumps(tasks, indent=None)

# Print or use the JSON data as needed
print(json_data)
Loading