David Kimura PRO
Joined 7/18/2015
Drifting Ruby Owner
David Kimura PRO said about 6 years ago on Two Factor Authentication :
  Looks like they changed their API a bit.

user.otp_code # => '850738'

qr = RQRCode::QRCode.new('http://github.com')
result = ''

qr.qrcode.modules.each do |row|
  row.each do |col|
    result << (col ? 'X' : 'O')
  end

  result << "\n"
end

David Kimura PRO said about 6 years ago on Drag and Drop with draggable :
  yes, you could jQueryUI and StimulusJS isn't an absolute necessity, but it does make things a bit easier with the selectors and keeping the code more organized. 

David Kimura PRO said about 6 years ago on Streaming Videos with Active Storage :
  instead of this.playerTarget you could use a DOM selector like document.getElementById

David Kimura PRO said about 6 years ago on Streaming Videos with Active Storage :
You wouldn't be able to use the connect(), initialize(), and disconnect() as those are functions for stimulus. Since your ID attribute of your video player is my-video then you would need to change the selector to document.getElementById('my-video') 

So it should look something more like this.

import videojs from 'video.js'
import 'video.js/dist/video-js.css'

$(document).on('turbolinks:load', function(){
  let videoPlayer = videojs(document.getElementById('my-video'), {
    controls: true,
    playbackRates: [0.5, 1, 2],
    autoplay: false,
    fluid: true
  })
  videoPlayer.addClass('video-js')
  videoPlayer.addClass('vjs-big-play-centered')
});