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
| @Composable | |
| fun ClockWidget(viewModel: ClockViewModel = koinViewModel()) { | |
| val time by viewModel.time.collectAsState() | |
| Box( | |
| modifier = Modifier.fillMaxSize(), | |
| contentAlignment = Alignment.Center, | |
| ) { | |
| Box( | |
| modifier = Modifier |
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
| @Composable | |
| fun App() { | |
| Box( | |
| modifier = Modifier.fillMaxSize(), | |
| contentAlignment = Alignment.Center, | |
| ) { | |
| Box( | |
| modifier = Modifier | |
| .clip(RoundedCornerShape(6.dp)) | |
| .background(Color(0x99000000)) |
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
| Window( | |
| // .... | |
| undecorated = true, // kills the OS title bar | |
| transparent = true, // makes the window background see-through | |
| resizable = false, | |
| alwaysOnTop = true, | |
| // .... | |
| ) { | |
| WindowDraggableArea { // since there's no title bar to drag, this wraps the content and handles it | |
| App() |
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
| // Talk to Windows UI layer | |
| [DllImport("user32.dll")] | |
| // Read the window style | |
| GetWindowLong(windowHandle, EXTENDED_STYLE) | |
| // Add the "hide from taskbar" flag and apply it | |
| SetWindowLong(windowHandle, EXTENDED_STYLE, currentStyle | 0x80) |
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
| const params = new URLSearchParams(window.location.search); | |
| if (params.get("q")) { | |
| const trySend = setInterval(() => { | |
| const button = document.querySelector('button[aria-label="Send message"]'); | |
| if (button && !button.disabled) { | |
| button.click(); | |
| clearInterval(trySend); | |
| } | |
| }, 200); | |
| setTimeout(() => clearInterval(trySend), 5000); |
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
| chrome.contextMenus.onClicked.addListener((info) => { | |
| if (info.menuItemId !== "askClaude") return; | |
| const text = `I selected "${info.selectionText}" on my browser\n\nI would normally Google this. Tell me what I need to know.`; | |
| chrome.tabs.create({ url: `https://claude.ai/new?q=${encodeURIComponent(text)}` }); | |
| }); |
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
| { | |
| "manifest_version": 3, | |
| "name": "Ask Claude", | |
| "version": "1.0", | |
| "description": "Right-click selected text to ask Claude", | |
| "permissions": ["contextMenus"], | |
| "background": { | |
| "service_worker": "background.js" | |
| }, | |
| "content_scripts": [ |
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
| @app.route("/claps", methods=["GET"]) | |
| def get_claps(): | |
| data, _ = get_claps_file() | |
| key = normalise_url(request.args.get("url")) | |
| return jsonify({"claps": data.get(key, 0)}) | |
| @app.route("/claps", methods=["POST"]) | |
| def add_clap(): | |
| data, sha = get_claps_file() | |
| key = normalise_url(request.args.get("url")) |
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
| class RetainDecorator<T : Any>( | |
| retainedValuesStoreRegistry: RetainedValuesStoreRegistry, | |
| ) : NavEntryDecorator<T>( | |
| decorate = { entry -> | |
| logDebug { "Retaining ${entry.contentKey}" } | |
| retainedValuesStoreRegistry.LocalRetainedValuesStoreProvider(entry.contentKey) { | |
| entry.Content() | |
| } | |
| }, |
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
| @Composable | |
| fun GameScreen( | |
| gameViewModel: GameViewModel = viewModel() | |
| ) { | |
| // ... | |
| } |