Brief introduction to “Keyed Redis”. What are the benefits of using it over “vanilla” Redis access? When does it make sense to use it instead of persisting to the database?
What problem are we trying to solve?
Brief introduction to “Keyed Redis”. What are the benefits of using it over “vanilla” Redis access? When does it make sense to use it instead of persisting to the database?
What problem are we trying to solve?
| post "events", to: "events#create", constraints: ->(req) do | |
| req.user_agent == "SavvyCal Webhooks (https://savvycal.com)" && | |
| req.params["type"] == "event.created" | |
| end | |
| post "events", to: "events#update", constraints: ->(req) do | |
| req.user_agent == "SavvyCal Webhooks (https://savvycal.com)" && | |
| ["event.rescheduled", "event.canceled"].include?(req.params["type"]) | |
| end |
| import { Controller } from '@hotwired/stimulus' | |
| import autoAnimate from '@formkit/auto-animate' | |
| export default class extends Controller { | |
| connect () { | |
| autoAnimate(this.element) | |
| } | |
| } |
| resources :media, shallow: true, | |
| constraints: ->(req) do | |
| current_user = req.env["warden"].user(:user) | |
| Flipper.enabled?(:media_uploads, current_user) | |
| end |
| class Chart < ApplicationRecord | |
| validate do |chart| | |
| schema = Rails.cache.fetch("vega_lite_schema/v5") do | |
| Faraday.get("https://vega.github.io/schema/vega-lite/v5.json").body | |
| end | |
| JsonSchemaValidator.new(chart, schema: schema, json: vega_json, field: :vega_json).validate | |
| end | |
| end |
| import { Controller } from '@hotwired/stimulus' | |
| export default class extends Controller { | |
| connect () { | |
| this.element.addEventListener('change', this.handleChange.bind(this)) | |
| } | |
| handleChange (event) { | |
| this.traverseDown(event.target, event.target.checked) |
| import { Controller } from '@hotwired/stimulus' | |
| export default class extends Controller { | |
| connect () { | |
| this.element.addEventListener('change', this.handleChange.bind(this)) | |
| } | |
| handleChange (event) { | |
| this.traverseDown(event.target, event.target.checked) | |
| } |
| class Event < ApplicationRecord | |
| # Associations | |
| belongs_to :owner, class_name: "User", optional: true | |
| belongs_to :event_source, polymorphic: true | |
| has_noticed_notifications | |
| # ... | |
| end |
| require "faraday" | |
| require "faraday/multipart" | |
| token = ARGV.shift | |
| absolute_path = File.expand_path(ARGV.shift) | |
| # TODO how could we require "active_storage/blob" without eager loading the whole app | |
| blob = ActiveStorage::Blob.build_after_unfurling(io: File.open(absolute_path), filename: File.basename(absolute_path)) |
| import { UpdatesForElement } from "cable_ready"; | |
| import activeElement from "cable_ready/javascript/active_element"; | |
| document.addEventListener("stimulus-reflex:before", (event) => { | |
| recursiveMarkUpdatesForElements(event.detail.element); | |
| }); | |
| document.addEventListener("stimulus-reflex:after", (event) => { | |
| setTimeout(() => { | |
| recursiveUnmarkUpdatesForElements(event.detail.element); |