opencode auth login
# Select "Kimi For Coding"
# Enter your API key (sk-kimi-...)- Proactor
- Proactor vs Reactor
- The Reactor patterns involve synchronous I/O, whereas the Proactor pattern involves asynchronous I/O. In Reactor, the event demultiplexor waits for events that indicate when a file descriptor or socket is ready for a read or write operation. The demultiplexor passes this event to the appropriate handler, which is responsible for performing the actual read or write.
- In the Proactor pattern, by contrast, the handler—or the event demultiplexor on behalf of the handler—initiates asynchronous read and write operations. The I/O operation itself is performed by the operating system (OS). The parameters passed to the OS include the addresses of user-defined data buffers from which the OS gets data to write, or to which the OS puts data read. The event demultiplexor waits for events t
| # Copyright (C) 2006-2016 Amazon.com, Inc. or its affiliates. | |
| # All Rights Reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"). | |
| # You may not use this file except in compliance with the License. | |
| # A copy of the License is located at | |
| # | |
| # http://aws.amazon.com/apache2.0/ | |
| # | |
| # or in the "license" file accompanying this file. This file is |
| #!/usr/bin/env bash | |
| ### | |
| ## This mounts a (single) ephemral NVMe drive in an EC2 server. | |
| ## It's meant to be run once, within user-data | |
| ## For EBS drives (non-ephemeral storage), see: https://gist.github.com/jalaziz/c22c8464cb602bc2b8d0a339b013a9c4 | |
| # | |
| #!/usr/bin/env bash | |
| # ========================================================== configurations === | |
| RAID_NAME=ephemeral_raid | |
| RAID_DEVICE=/dev/md0 | |
| RAID_MOUNT_PATH=/mnt/ephemeral | |
| # =============================================================== functions === |
Beast Mode is a custom chat mode for VS Code agent that adds an opinionated workflow to the agent, including use of a todo list, extensive internet research capabilities, planning, tool usage instructions and more. Designed to be used with 4.1, although it will work with any model.
Below you will find the Beast Mode prompt in various versions - starting with the most recent - 3.1
- Go to the "agent" dropdown in VS Code chat sidebar and select "Configure Modes".
- Select "Create new custom chat mode file"
If you're an SRE or DevOps engineer, you'll usually find yourself writing scripts to automate tasks. But a collection of scripts, probably written by different members of the team, with different standards and tools, will soon become unmaintainable and trigger conversations such as "Can the script do this?" or "How do I make this change?". Sometimes, you may even have those conversations with yourself because after a while you no longer understand your own code.
If you think of your scripts not so much as a set of commands run one after another but as command-line applications, which should meet certain standards and follow good coding practices, they'll become much more user-friendly and maintainable.
Disclaimers:
- This list should be specially useful for people writing scripts from scratch. If you're working on a big project as a developer, it's likely that many of the tools I'll describe (or some alternative) are already in use. But if the
| #!/usr/bin/env python3 | |
| # The MIT License (MIT) | |
| # Copyright © 2025 Dan Gheorghe Haiduc | |
| # | |
| # 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. | |
| # |
| // | |
| // Combine+Pairwise.swift | |
| // | |
| // Created by Felix Mau on 17.05.21. | |
| // Copyright © 2021 Felix Mau. All rights reserved. | |
| // | |
| import Combine | |
| extension Publisher { |
| /** | |
| * I needed a property wrapper that fulfilled the following four requirements: | |
| * | |
| * 1. Values are stored in UserDefaults. | |
| * 2. Properties using the property wrapper can be used with SwiftUI. | |
| * 3. The property wrapper exposes a Publisher to be used with Combine. | |
| * 4. The publisher is only called when the value is updated and not | |
| * when_any_ value stored in UserDefaults is updated. | |
| * | |
| * First I tried using SwiftUI's builtin @AppStorage property wrapper |