This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | |
<title>Webduino Blockly Timeout Demo</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script src="https://webduino.io/components/webduino-js/dist/webduino-all.min.js"></script> | |
<script src="https://blockly.webduino.io/webduino-blockly.js"></script> | |
<script src="https://blockly.webduino.io/lib/runtime.min.js"></script> |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | |
<title>Webduino Blockly Timeout Demo</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script src="https://webduino.io/components/webduino-js/dist/webduino-all.min.js"></script> | |
<script src="https://blockly.webduino.io/webduino-blockly.js"></script> | |
<script src="https://blockly.webduino.io/lib/runtime.min.js"></script> |
This file contains 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
// ref: https://gist.github.com/vcastroi/e0d296171842e74ad7d4eef7daf15df6 | |
(function() { | |
const element = document.querySelector('#test-layout-styles'); | |
if (element) { | |
document.head.removeChild(element); | |
} else { | |
const style = document.createElement('style'); | |
style.id = 'test-layout-styles'; | |
style.innerHTML = ` | |
* { |
This file contains 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
(function() { | |
let title = document.querySelector('[data-testid=nowplaying-track-link]').textContent; | |
let singers = document.querySelector('[data-testid="track-info-artists"]').querySelectorAll('a'); | |
let singerList = [...singers].map(x => x.textContent).join(' & '); | |
let textArea = document.createElement('textarea'); | |
textArea.value = `${singerList} - ${title}`; | |
document.body.appendChild(textArea); | |
textArea.select(); | |
document.execCommand('Copy'); | |
textArea.remove(); |
This file contains 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
(function() { | |
var title = document.title; | |
var url = location.href; | |
var textArea = document.createElement('textarea'); | |
var copyText = `[${title}](${url})`; | |
textArea.value = copyText; | |
document.body.appendChild(textArea); | |
textArea.select(); | |
document.execCommand('Copy'); |
This file contains 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
(function() { | |
const params = [ | |
'utm_term', | |
'utm_source', | |
'utm_medium', | |
'utm_content', | |
'utm_campaign', | |
'up_id', | |
'unique_k', | |
'timestamp', |
This file contains 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
!(() => { | |
const captionElements = document.getElementsByClassName('segment-text style-scope ytd-transcript-segment-renderer'); | |
const caption = [...captionElements] | |
.reduce((result, element) => result + element.innerText + ' ', '') | |
.replace(/[\.]/g, '.\n\n'); | |
const textArea = document.createElement('textarea'); | |
copyText = caption; | |
textArea.value = copyText; | |
document.body.appendChild(textArea); |
This file contains 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
urlIconSelector = 'path[d*="M3.73333,3.86667 L7.46667"]'; | |
urlIcons = document.querySelectorAll(urlIconSelector); | |
blocks = Array.prototype.map.call(urlIcons, icon => { | |
urlTitleNode = icon.parentNode.parentNode.nextSibling; | |
if (urlTitleNode.textContent === 'URL') { | |
urlValueNode = urlTitleNode.parentNode.parentNode.parentNode.nextSibling; | |
if (urlValueNode.textContent[0] !== 'Empty') | |
return urlValueNode.querySelector('span'); |
This file contains 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
translateElement = document.getElementById('gtx-host'); | |
translateContentElements = translateElement.shadowRoot.getElementById('bubble-content'); | |
translateOptions = [...translateContentElements.querySelectorAll('option')]; | |
languages = ['zh-CN', 'auto', 'en', 'ja']; | |
translateOptions.filter(option => !languages.includes(option.value)) | |
.forEach(option => option.remove()); |
This file contains 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
import time | |
import math | |
import os | |
rows, columns = os.popen('stty size', 'r').read().split() | |
# `[]` (2) + precent (5) | |
terminal_progress_fill = int(columns) - 7 | |
current_progress = 0 | |
while current_progress <= 100: |
OlderNewer