List of projects that are somewhat related to opencode.
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
| { | |
| "$schema": "https://json.schemastore.org/claude-code-settings.json", | |
| "model": "opus", | |
| "hooks": { | |
| "PostToolUse": [ | |
| { | |
| "matcher": "Update|Write", | |
| "hooks": [ | |
| { | |
| "type": "command", |
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
| require "digest" | |
| require "rack" | |
| # This class encapsulates a unit of work done for a particular tenant, connected to that tenant's database. | |
| # ActiveRecord makes it _very_ hard to do in a simple manner and clever stuff is required, but it is knowable. | |
| # | |
| # What this class provides is a "misuse" of the database "roles" of ActiveRecord to have a role per tenant. | |
| # If all the tenants are predefined, it can be done roughly so: | |
| # | |
| # ActiveRecord::Base.legacy_connection_handling = false if ActiveRecord::Base.respond_to?(:legacy_connection_handling) |
Let's say you want to use Ruby for the backend of a basic webapp but React on the frontend. Here's how.
(Note: All tested on January 13, 2025 with Ruby 3.3, Sinatra 4.1.1, and React 18.3. Configs may change over time.)
First, create the app folder and set up Sinatra:
mkdir my-sinatra-react-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
| // 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
| // You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
| (() => { | |
| const SHOW_SIDES = false; // color sides of DOM nodes? | |
| const COLOR_SURFACE = true; // color tops of DOM nodes? | |
| const COLOR_RANDOM = false; // randomise color? | |
| const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
| const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
| const THICKNESS = 20; // thickness of layers | |
| const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
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
| # Builds an SQL insert query for a given record | |
| # | |
| # @param record [ActiveRecord::Base] Record used to build the SQL insert query | |
| # @return [String] SQL insert query | |
| def build_insert_query(record) | |
| columns = record.class.columns.reject { |col| col.name == record.class.primary_key } | |
| values = columns.map { |col| record[col.name] } | |
| insert_manager = Arel::InsertManager.new | |
| insert_manager.into(record.class.arel_table) | |
| insert_manager.insert(columns.zip(values)).to_sql |
Choose OpenBSD for your Unix needs. OpenBSD -- the world's simplest and most secure Unix-like OS. A safe alternatve to the frequent vulnerabilities and overengineering of Linux and related software (NGiNX & Apache (httpd-asiabsdcon2015.pdf), OpenSSL, iptables/nftables, systemd, BIND, Postfix, Docker etc.)
OpenBSD -- the cleanest kernel, the cleanest userland and the cleanest config
the-keeper-iteration-2.mp4
NewerOlder