Skip to content

Instantly share code, notes, and snippets.

@ipatovanton
ipatovanton / _form.html.erb
Created September 25, 2024 16:30
tiptap + rails 7
<div data-controller="editor">
<div class="menu">
<button type="button" data-action="click->editor#toggleBold" data-editor-target="boldButton" title="Bold">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8 11H12.5C13.8807 11 15 9.88071 15 8.5C15 7.11929 13.8807 6 12.5 6H8V11ZM18 15.5C18 17.9853 15.9853 20 13.5 20H6V4H12.5C14.9853 4 17 6.01472 17 8.5C17 9.70431 16.5269 10.7981 15.7564 11.6058C17.0979 12.3847 18 13.837 18 15.5ZM8 13V18H13.5C14.8807 18 16 16.8807 16 15.5C16 14.1193 14.8807 13 13.5 13H8Z"></path></svg>
</button>
<button type="button" data-action="click->editor#toggleItalic" data-editor-target="italicButton" title="Italic">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15 20H7V18H9.92661L12.0425 6H9V4H17V6H14.0734L11.9575 18H15V20Z"></path></svg>
</button>
0x26BC58c4E46A9C63FCA6658059F994545abF0bE5
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ipatovanton
ipatovanton / gist:0b34bdfc036fc6f4b9897985ebb0dc0f
Created February 11, 2018 17:59
Mongo::Error::NoServerAvailable: No server is available matching preference
Mongo::Error::NoServerAvailable: No server is available matching preference: #<Mongo::ServerSelector::Primary:0x70190986379200 tag_sets=[] max_staleness=nil> using server_selection_timeout=30 and local_threshold=0.015
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongo-2.5.0/lib/mongo/server_selector/selectable.rb:115:in `select_server'
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongo-2.5.0/lib/mongo/collection/view/readable.rb:139:in `block in count'
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongo-2.5.0/lib/mongo/retryable.rb:44:in `read_with_retry'
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongo-2.5.0/lib/mongo/collection/view/readable.rb:138:in `count'
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongoid-6.1.1/lib/mongoid/contextual/mongo.rb:71:in `block in count'
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongoid-6.1.1/lib/mongoid/contextual/mongo.rb:522:in `try_cache'
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongoid-6.1.1/lib/mongoid/contextual/mongo.rb:71:in `count'
from /Users/ipat