Skip to content

Instantly share code, notes, and snippets.

View ingenuine's full-sized avatar
🌱
Planting seeds

Marko Delic ingenuine

🌱
Planting seeds
View GitHub Profile
class HashSchema
def initialize(schema)
@schema = schema.map { |key, type|
[key, HashSchema.lookup(type)]
}.to_h
end
def cast(params)
params.map { |key, value|
[key, @schema[key] ? @schema[key].cast(value) : value]
import {Controller} from '@hotwired/stimulus'
import {Editor} from "@tiptap/core"
import {Mention} from "@tiptap/extension-mention";
import StarterKit from "@tiptap/starter-kit"
export default class extends Controller {
static targets = ['input', 'suggestions']
connect() {
this.editor = new Editor({