This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def generate_link_targets(path) | |
| target = {} | |
| Dir.glob("#{path}/*") do |dirname| | |
| scope = File.basename(dirname) | |
| target[scope] = {} | |
| Dir.glob("#{dirname}/**/*.md") do |filename| | |
| File.open(filename, 'r') do |file| | |
| until file.eof? do | |
| case file.readline | |
| when /^title: "(?:附录)?([\w.]+) [^"]+"/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'openssl' | |
| class String | |
| def to_byte | |
| [self].pack('H*') | |
| end | |
| end | |
| class Integer | |
| def to_byte(size) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |