Twilight Coders, LLC · Colorado · Open source since 2013

We build quiet, reliable software, from the database layer to the tools on our own desks.

This is the open-source side of the studio: a decade of ActiveRecord extensions, Terraform providers for our own rack, and the editor and terminal tools we wanted and could not find.

RubyGems downloads
570,000+
Open-source projects
56
Publishing since
2013

Selected work

The projects we’d show first

  1. create_table 'account/users', inherits: :accounts do |t|
      t.string :email
    end
    
    Account.all
    # => [#<User ...>, #<Admin ...>, #<Developer ...>]

    PostgreSQL & ActiveRecord Active

    ActiveRecord::MTI

    Single-table inheritance puts every subclass in one wide table. ActiveRecord::MTI gives each subclass its own table, using the inheritance PostgreSQL already has.

    • No type column: the row’s own table decides its class
    • inherits: in migrations, preserved in schema.rb
    • Mix MTI and STI in one hierarchy

    How it works: ActiveRecord::MTI Source

  2. User.quick_count
    User.quick_count(threshold: 1_000_000)
    User.where(active: true).count_estimate

    PostgreSQL & ActiveRecord Active

    QuickCount

    SELECT COUNT(*) on a table with hundreds of millions of rows is a full scan. The database planner already knows roughly how many rows there are.

    • 455M rows: 0.046 s estimated vs 310 s exact
    • Exact below a configurable threshold
    • count_estimate for filtered relations

    How it works: QuickCount Source

  3. CodeShelf shelves view: project cards grouped into shelves with language and branch

    Editor tooling Active

    CodeShelf

    A Steam-library-style view of every project you have ever built, one window away.

    • Shelves, workbench and timeline views
    • Automatic tags from TF-IDF over your own code
    • Search by README and source vocabulary

    How it works: CodeShelf VS Code Marketplace

  4. TrueNAS

    provider "truenas" {
      host     = "nas.lan"
      username = "truenas_admin"
      # api_key from TRUENAS_API_KEY
    }
    
    resource "truenas_snapshot_task" "home" {
      dataset        = "tank/home"
      recursive      = true
      lifetime_value = 14
      lifetime_unit  = "DAY"
      schedule = {
        minute = "45"
        hour   = "2"
      }
    }

    Infrastructure & homelab Active

    Terraform providers

    Two providers for the gear in our own rack, each built on an API that was never meant to be driven this way.

    • TrueNAS: 40+ resources, write-only secrets, list/query import
    • Terraform 1.14 actions: run a replication, scrub a pool, restart an app
    • Alta: commit-confirmed applies with automatic rollback

    How it works: Terraform providers TrueNAS source

  5. Monopolia chart of U.S. airline market share from 1990 to 2024, with lines merging at each acquisition and events such as September 11 and the COVID-19 pandemic marked

    Visualizations & games Stable

    Monopolia

    Scrub a slider through thirty-four years and watch each company’s market share line fold into its acquirer on the day the merger closed.

    • 13 industries, 1990 to 2024
    • Mergers animate on their closing dates
    • CR4 / CR8 concentration overlay

    How it works: Monopolia Open Monopolia

  6. Ergane

    class MyCLI < Ergane::Tool
      tool_name :mycli
      version "1.0.0"
    
      command :greet do
        option :name, String, short: :n, default: "world"
        run { puts "Hello #{options[:name]}!" }
      end
    end
    
    MyCLI.start(ARGV)

    Ruby libraries & tools Active

    Ergane & Potty

    Two libraries for tools that live in the terminal: Ergane for the command tree, Potty for everything drawn on screen.

    • Arguments inferred from method signatures
    • Nested subcommands and shared options
    • Full-screen curses or inline ANSI rendering

    How it works: Ergane & Potty Ergane source

The catalog

Everything we maintain in the open

Grouped by what it is for. Stars and downloads come from GitHub and RubyGems when the site is built.

PostgreSQL & ActiveRecord

Extensions for the Rails layer that sits on the database: native table inheritance, planner-estimated counts, soft deletes and query framing.

  • Maps Rails model subclasses onto PostgreSQL’s native table inheritance.

    Ruby 97 stars 54k downloads since 2016

  • QuickCount

    Active

    Near-exact row counts for very large tables, in milliseconds instead of minutes.

    Ruby 15 stars 29k downloads since 2017

  • Scope-like filters applied as a common table expression instead of a WHERE clause.

    Ruby 2 stars 22k downloads since 2019

  • DeletedAt

    Dormant

    Soft deletes that hide rows by timestamp without a default_scope.

    Ruby 4 stars 58k downloads since 2014

  • Doppel

    Dormant

    Finds near-duplicate records by Levenshtein distance using PostgreSQL’s fuzzystrmatch.

    Ruby 6k downloads since 2015

  • VirtualView

    Dormant

    Backs a model with an Arel query defined in Ruby instead of a database table.

    Ruby 4.4k downloads since 2018

  • Answers jQuery DataTables server-side requests from a Rails controller with render dt:.

    Ruby 31k downloads since 2016

  • Resolves has_many and :through associations to namespaced subclasses automatically.

    Ruby 3k downloads since 2018

Ruby libraries & tools

Frameworks for command-line and terminal apps, native extensions, and API clients built where no good one existed.

  • A command-line framework and a terminal-UI framework for Ruby, built to work together.

    Ruby 1.7k downloads since 2023

  • mdai

    Active

    Turns a video into one dense markdown brief that an AI agent can read.

    Ruby since 2026

  • Ruby Sudo

    Stable

    Runs selected Ruby method calls as root from an unprivileged process, through sudo.

    Created by Guido De Rosa; co-maintained here.

    Ruby 15 stars 53k downloads since 2010

  • Deprecate

    Stable

    Marks methods deprecated in one line, with caller locations and a suggested replacement.

    Ruby 39k downloads since 2025

  • Registry

    Active

    An indexed in-memory collection that re-indexes objects when their attributes change.

    Ruby 18k downloads since 2018

  • PBKDF2 key derivation as a C extension, about 1.4–1.8× faster than OpenSSL from Ruby.

    C 837 downloads since 2025

  • Bluetooth Low Energy scanning, pairing and GATT reads and writes on macOS, Linux and Windows.

    C 1 stars 655 downloads since 2025

  • AltaLabs

    Active

    Ruby SDK for Alta Labs networking, reverse-engineered, with native Cognito SRP login.

    Ruby 1 stars 947 downloads since 2026

  • Pandoru

    Active

    A Ruby port of pydora for Pandora’s unofficial API: stations, playlists and search.

    Ruby 634 downloads since 2025

  • JumpCloud

    Dormant

    Ruby client for the JumpCloud directory API and its host agent.

    Ruby 19k downloads since 2018

  • ERLE

    Dormant

    Parses Erlang terms (tuples, atoms, binaries, pids) into Ruby data.

    Ruby 3.3k downloads since 2018

Infrastructure & homelab

Terraform providers, CI runners and packaging for the machines we run ourselves.

Editor tooling

VS Code extensions for finding your projects and living in the terminal.

Visualizations & games

Work that is meant to be looked at.

From the archive 5 older projects, kept public for the people still using them
  • Enumerate Enum attributes for ActiveRecord with predicates, bang setters and scopes, from before Rails had enums. 2013 · 7.7k downloads
  • Fail2Ban for iocage Fail2Ban packaged as a FreeNAS iocage plugin, banning SSH brute-forcers from a jail. 2019
  • FreeNAS Rails Setup A 2014 walkthrough for hosting Rails behind nginx and Unicorn in a FreeNAS jail. 2014
  • clockpicker-rails The ClockPicker time picker, packaged for the Rails asset pipeline. 2015 · 194k downloads
  • foo_table-rails The FooTable responsive-table plugin, packaged for the Rails asset pipeline. 2014 · 34k downloads

Smaller experiments and forks are on GitHub.

Upstream

Fixes we sent back

When a library we depend on needs work, we do it in the open and offer it to the maintainers.

  • Him remi/her

    A continuation of the Her REST-resource ORM for Ruby 3.1+, Rails 6.1+ and Faraday 2, with JSON:API compound documents and about twenty association and dirty-tracking fixes. Published as the him gem; the same changes are offered upstream as remi/her#554.

    Published · 2026

  • flock discoteq/flock

    CI, bug fixes, a comprehensive test suite and a refactor for the portable flock(1) implementation.

    Merged upstream · 2026

  • xterm-link-provider LabhanshAgrawal/xterm-link-provider

    Moved the link provider to @xterm/xterm 6.0. A follow-up fixing link-position drift is open as #41.

    Merged upstream · 2026

  • workflow geekq/workflow

    Negative class- and instance-level scopes (#112, 2014), then a modernization with CI across Ruby 2.3–2.5 and ActiveRecord 4.1–5.2 (#209, 2019).

    Merged upstream · 2019

About

A small studio with a long memory

Twilight Coders, LLC is an independent software studio in Colorado, led by Dale Stevens. The GitHub organization dates to 2012, and the first gem shipped in 2013. Most of what is here started the same way: a Rails app we were building needed something ActiveRecord did not do, so we wrote it and published it.

Ruby and PostgreSQL are home. Over time the work has spread out to the machines we run: Terraform providers for our own network and storage, packaging, CI runners and editor tooling.

The rule we try to hold is that simple, well-understood systems outperform clever ones. It shows up as small libraries that each do one job, and as tools that are honest about their limits.

Our commercial apps, starting with upuppy, live at twilightcoders.com.

Organization
Twilight Coders, LLC
Based in
Colorado, USA
On GitHub since
2012
Open-source projects
56
Gem downloads
570,000+
Mostly written in
Ruby, C, Go, TypeScript
Motto
Dream. Code.

Sneak peek

On the workbench

Projects we are building now and are not quite ready to show. They will get a proper page when they are.

  • PostgreSQL · C

    ProgreSQL

    A PostgreSQL fork that adds indexes enforcing uniqueness across every partition of a table, and foreign keys that can point into any child of an inheritance tree. Its regression and recovery suites pass; it has not yet been run at scale.

  • Game · C++

    Galaxer

    A real-time space-conquest game. Every planet you hold builds ships over time, and you send fleets to capture neutral and enemy planets until one player remains.

Looking for our apps?

upuppy and the rest of our commercial software, with support and contact, live at twilightcoders.com.