Skip to content

Instantly share code, notes, and snippets.

View zealot128's full-sized avatar

Stefan Wienert zealot128

View GitHub Profile
@bazzel
bazzel / README.md
Last active March 20, 2022 22:00
Webpacker and I18n
$ rails new my-i8n --webpack

Gemfile

gem 'i18n-js'
@castwide
castwide / rails.rb
Last active April 27, 2024 08:54
Enhance Rails Intellisense in Solargraph
# The following comments fill some of the gaps in Solargraph's understanding of
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but
# ignored at runtime.
#
# You can put this file anywhere in the project, as long as it gets included in
# the workspace maps. It's recommended that you keep it in a standalone file
# instead of pasting it into an existing one.
#
# @!parse
# class ActionController::Base

Various search databases and backends as alternatives to Elasticsearch.

Rust

@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@zealot128
zealot128 / rails-models-to-typescript-schema.rb
Last active February 18, 2024 12:11
Simple ruby script to generate Active Record Typescript information with enums + associations
# USAGE:
# rails runner rails-models-to-typescript-schema.rb > app/javascript/types/schema.d.ts
Rails.application.eager_load!
models = ActiveRecord::Base.descendants.reject { |i| i.abstract_class? }
belongs_to = true
has_many = true