This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print("__name__ is", __name__) | |
| DEV = True # True for development with hot reload, False for production with no hot reload | |
| from nicegui.ui_run import run as ui_run # just importing the function to run the server | |
| if not DEV or not __name__ == "__main__": # you can do `if True:` to bypass this to revert to the normal behavior, but that is slow... | |
| # Explanation: 2 reasons for running this code: | |
| # 1. not in dev mode, so there is no __mp_main__, this is already where NiceGUI will run | |
| # 2. or, in dev mode, and this is the __mp_main__, so we want to run this code | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from nicegui import ui | |
| class my_widget: | |
| def __init__(self, name, value): | |
| self.name = name | |
| self.value = value | |
| self.container = ui.row() | |
| self.create_widget() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| adg// NOTE: I only go so far as to ensure this works with the nicegui-speed | |
| // Based on NiceGUI 2.12.1 | |
| const True = true; | |
| const False = false; | |
| const None = undefined; | |
| let app = undefined; | |
| let mounted_app = undefined; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from nicegui.element import Element | |
| class MyRowSoftload(Element, component='my_row_softload.js'): | |
| def __init__(self, *, day_texts=[], day_checked=[]) -> None: | |
| super().__init__() | |
| self._props["day_texts"] = day_texts | |
| self._props["day_checked"] = day_checked |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| template: ` | |
| <div class="w-full flex px-4 text-xs text-[#4F3028] text-center h-[32px]" ref="observerTarget"> | |
| <template v-if="isVisible"> | |
| <div class="flex w-full"> | |
| <div v-for="(checked, index) in day_checked" :key="'header-' + index" :class="{'font-bold': index === day_checked.length - 1, 'text-center': true, 'flex-grow': true, 'basis-0': true}"> | |
| {{ day_texts[index] }} | |
| </div> | |
| </div> | |
| <div class="flex w-full"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifdef DEBUG_MODE | |
| #define cout_debug std::cout | |
| #else | |
| #define cout_debug if (false) std::cout | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Generated with Poe. Prompt here: | |
| // https://poe.com/s/wo0SFXk51vRy5lYWOTKP | |
| // meant to be used with "Analyze Rating" page of https://github.com/myjian/mai-tools | |
| // ONLY after data has been loaded!!! | |
| // Get all elements with class "songRecordTable" | |
| const songTables = document.querySelectorAll(".songRecordTable"); | |
| // Initialize two empty arrays for the rating cells |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import re | |
| pattern = r"glib\.lib\(([^)]*)\)" | |
| libraries = [] | |
| with open("list/firmware.map", "r") as f: | |
| for line in f: | |
| if "glib.lib" in line: | |
| match = re.search(pattern, line) |
NewerOlder