name: scout description: 'Local codebase reconnaissance for locating files, flows, patterns, and conventions in the current repo.' tools: read, bash, grep, write model: openai/gpt-5.4-mini thinking: high allow-model-override: true allowed-models: anthropic/claude-haiku-4-5, zai/glm-5-turbo:high mode: background auto-exit: true
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
| #!/usr/bin/env bash | |
| # Installs NixOS on a Leaseweb server, wiping the server. | |
| # | |
| # This is for a specific server configuration; adjust where needed. | |
| # Originally written for a Leaseweb HP DL120 G7 server. | |
| # | |
| # Prerequisites: | |
| # * Update the script to adjust SSH pubkeys, hostname, NixOS version etc. | |
| # |
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
| #!/usr/bin/env bash | |
| # Installs NixOS on a Hetzner server, wiping the server. | |
| # | |
| # This is for a specific server configuration; adjust where needed. | |
| # | |
| # Prerequisites: | |
| # * Update the script to adjust SSH pubkeys, hostname, NixOS version etc. | |
| # | |
| # Usage: |
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 'cgi' | |
| require 'json' | |
| require 'active_support' | |
| def verify_and_decrypt_session_cookie(cookie, secret_key_base = Rails.application.secrets.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] |
Note: We plan to do a thorough documentation pass in the coming weeks to clean up and document the codebase. This document is a very rough draft intended to help intrepid adventurers navigate the jungle until then.
- Cardinality - The number of results a thing would return.
- Intermediate - A value which is necessary to derive the final result, but not part of the result.
- Referential Transparency - The property of always returning exactly the same output given an input.
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
| #! /bin/ruby | |
| def main argv | |
| n = (argv[0] || 2).to_i rescue 2 | |
| m = (argv[1] || 20).to_i rescue 20 | |
| g = n_gram n | |
| g. | |
| enum_for(:each_pair). | |
| lazy. | |
| sort_by {|k, v| -v }. |
-
Add Graal JIT Compilation to Your JVM Language in 5 Steps, A Tutorial http://stefan-marr.de/2015/11/add-graal-jit-compilation-to-your-jvm-language-in-5-easy-steps-step-1/
-
The SimpleLanguage, an example of using Truffle with great JavaDocs. It is the officle getting-started project: https://github.com/graalvm/simplelanguage
-
Truffle Tutorial, Christan Wimmer, PLDI 2016, 3h recording https://youtu.be/FJY96_6Y3a4 Slides
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
| def Process.gsub pat, sub | |
| mem = File.open('/proc/self/mem', 'r+') | |
| maps = File.open('/proc/self/maps') | |
| maps.each do |map| | |
| from, to, perms, offset = map.scan(/(\h+)-(\h+) (\S+) (\h+)/)[0] | |
| if perms['rw'] | |
| from, to = [from, to].map { |addr| addr.hex + offset.hex } | |
| data = mem.tap { |m| m.seek from }.read(to - from) rescue next |
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
| module Ova | |
| # autovivifying map from [class][method][signature] to Method | |
| @@Ova = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) } | |
| # Wrap #respond_to? for parity with Class#===. | |
| Responder = Struct.new(:method) do | |
| def === obj | |
| obj.respond_to?(method) | |
| end | |
| end |
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
| # rack_sse.ru | |
| # | |
| # An example of basic real-time, single-room broadcast chat using Server Sent | |
| # Events in plain old Rack. This example does NOT use hijack, or the async | |
| # hacks, it just relies on a well implemented threaded Rack server (at time of | |
| # writing this will therefore only work with puma!). Other servers should be | |
| # fixed to support this, as it is pretty critical to how Rack *should* work on | |
| # most servers. The only spec-acceptable failure in this case is not flushing | |
| # the content stream on each yield (for which the rack spec has no workaround | |
| # today). |
NewerOlder