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 TranslationsHelper | |
TRANSLATIONS = { | |
email_address: { "🇺🇸": "Enter your email address", "🇪🇸": "Introduce tu correo electrónico", "🇫🇷": "Entrez votre adresse courriel", "🇮🇳": "अपना ईमेल पता दर्ज करें", "🇩🇪": "Geben Sie Ihre E-Mail-Adresse ein" }, | |
password: { "🇺🇸": "Enter your password", "🇪🇸": "Introduce tu contraseña", "🇫🇷": "Saisissez votre mot de passe", "🇮🇳": "अपना पासवर्ड दर्ज करें", "🇩🇪": "Geben Sie Ihr Passwort ein" }, | |
update_password: { "🇺🇸": "Change password", "🇪🇸": "Cambiar contraseña", "🇫🇷": "Changer le mot de passe", "🇮🇳": "पासवर्ड बदलें", "🇩🇪": "Passwort ändern" }, | |
user_name: { "🇺🇸": "Enter your name", "🇪🇸": "Introduce tu nombre", "🇫🇷": "Entrez votre nom", "🇮🇳": "अपना नाम दर्ज करें", "🇩🇪": "Geben Sie Ihren Namen ein" }, | |
account_name: { "🇺🇸": "Name this account", "🇪🇸": "Nombre de esta cuenta", "🇫🇷": "Nommez ce compte", "🇮🇳": "इस खाते का नाम दें", "🇩🇪": "Benennen Sie dieses Konto" }, | |
room_name: { "🇺🇸": "Name the room", "🇪🇸": "Nombrar la sala", "🇫🇷": "Nommez la salle", |
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
# Job | |
discard_on CustomAppException, report: true | |
# In config/initializers/error_reporting.rb | |
class ErrorSubscriber | |
def report(error, handled:, severity:, context:) | |
if context[:source] == "application.active_job" | |
Sentry.capture_exception(error, extra: context) | |
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
class Member | |
has_one :latest_activity, -> { from(Activity.latest_by_member, :activities) }, class_name: "Activity" | |
end | |
class Activity | |
scope :latest_by_member, -> { select("DISTINCT ON (member_id) *").order(:member_id, created_at: :desc) } | |
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
{ | |
"theme": "One Light", | |
"buffer_font_family": "DejaVu Sans Mono", | |
"buffer_font_size": 16, | |
"show_whitespaces": "none", | |
"gutter": { "code_actions": false, "runnables": false, "breakpoints": false }, | |
"indent_guides": { "enabled": false }, | |
"toolbar": { "breadcrumbs": false, "quick_actions": false }, | |
"git_panel": { "dock": "right" }, | |
"scroll_beyond_last_line": "off", |
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 Element::Positionable | |
extend ActiveSupport::Concern | |
included do | |
before_create :set_position | |
before_update :reposition_before_update | |
validates_numericality_of :position, greater_than_or_equal_to: 1, on: :update | |
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
<%= form_with model: citizen, class: "card flex flex-col gap", data: { controller: "form" } do |form| %> | |
<div class="flex flex-col gap mb-2"> | |
<div class="flex flex-col gap-half"> | |
<% countries = Country.order(:name) %> | |
<%= label_tag :country_id, "Country", class: "text-sm font-medium leading-none" %> | |
<%= select_tag :country_id, options_from_collection_for_select(countries, :id, :name, citizen.country_id), include_blank: "Select one", class: "input", data: { action: "form#submit", form_submitter_param: "on_country_change" } %> | |
</div> | |
<div class="flex flex-col gap-half"> | |
<% states = State.where(country_id: citizen.country_id).order(:name) %> |
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
class TagBuilder | |
def initialize(context, tag_name, content = nil, klass: nil, default_attributes: {}, **attributes, &block) | |
@context = context | |
@tag_name = tag_name | |
@content = content | |
@klass = klass | |
@default_attributes = default_attributes | |
@attributes = attributes | |
@block = block | |
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
.tabs { | |
display: flex; | |
flex-direction: column; | |
gap: var(--size-2); | |
} | |
.tabs__list { | |
background-color: var(--color-border-light); | |
block-size: var(--size-10); | |
border-radius: var(--rounded-md); |
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 ApplicationHelper | |
def current_page_with_controllers?(controllers) | |
controllers.any? { |controller| current_page? controller: controller } | |
end | |
def current_page_with_actions?(actions) | |
actions.any? { |action| current_page? action: action } | |
end | |
def current_page_with_controllers_and_actions?(controllers, actions) |
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
<div data-controller="popover"> | |
<button class="btn" popovertarget="popover" data-popover-target="button"> | |
Open popover | |
</button> | |
<div popover id="popover" class="popover" data-popover-target="menu" data-action="beforetoggle->popover#update"> | |
<%= render "dimensions_form" %> | |
</div> | |
</div> |
NewerOlder