Skip to content

Instantly share code, notes, and snippets.

View YunzheZJU's full-sized avatar

Yunzhe YunzheZJU

  • Zhejiang University
  • Hangzhou, Zhejiang
View GitHub Profile
@YunzheZJU
YunzheZJU / crypto.rb
Created December 15, 2021 03:02
RFC 9001 Using TLS to Secure QUIC ‘Appendix A. Sample Packet Protection’ implemented with Ruby 3.0
require 'openssl'
class String
def to_byte
[self].pack('H*')
end
end
class Integer
def to_byte(size)
@YunzheZJU
YunzheZJU / ytb_chat_send.js
Created July 28, 2021 15:32
Procedures to send a youtube live chat text message including emojis automatically
// Paste these codes into Chrome's DevTools (F12) and hit 'Enter'
const frameDocument = document.querySelector('#chatframe').contentDocument
const inputElement = frameDocument.querySelectorAll('#input.yt-live-chat-text-input-field-renderer')[0]
const buttonElement = frameDocument.querySelectorAll('#send-button yt-icon-button')[0]
console.log({ frameDocument, inputElement, buttonElement })
// Set value
inputElement.innerHTML += 'test'
// This emoji HTML is ONLY available in lives of https://www.youtube.com/channel/UC-hM6YJuNYVAmUWxeIr9FeA