npm install -g @anthropic-ai/claude-code
claude --versionRequires Node.js 18+.
initialize: once, when the controller is first instantiatedconnect: anytime the controller is connected to the DOMYou certainly won't need anything installed other than Docker to create Ruby apps...
The idea is to mount the current folder into a temporary Ruby container using the official Ruby image from Docker Hub, then install Rails inside this temporary container, and then create the project skeleton using the rails new command.
# Start bash inside a Ruby container:| require 'cgi' | |
| require 'json' | |
| require 'active_support' | |
| def verify_and_decrypt_session_cookie(cookie, secret_key_base) | |
| cookie = CGI::unescape(cookie) | |
| salt = 'encrypted cookie' | |
| signed_salt = 'signed encrypted cookie' | |
| key_generator = ActiveSupport::KeyGenerator.new(secret_key_base, iterations: 1000) | |
| secret = key_generator.generate_key(salt)[0, ActiveSupport::MessageEncryptor.key_len] |
| class APIController < ApplicationController | |
| include JSONErrors | |
| # ... | |
| end |
| <?xml version="1.0"?> | |
| <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> | |
| <Configure id="Server" class="org.eclipse.jetty.server.Server"> | |
| <!-- only the relevant addition is listed here --> | |
| <Call name="addBean"> | |
| <Arg> | |
| <New class="org.eclipse.jetty.security.HashLoginService"> | |
| <Set name="name">MySolrRealm</Set> | |
| <Set name="config"> |
| require 'openssl' | |
| class String | |
| CIPHER_NAME = 'aes-256-cbc'.freeze | |
| PBKDF_ITER = 200_000 | |
| KEY_LEN = 32 # 256 bits | |
| SALT_CONST = "fixed-global-salt-v1".freeze | |
| IV_SALT_CONST = "fixed-iv-salt-v1".freeze | |
| def encrypt(password) |