網路上的window.speechSynthesis
教學主要都只有說切換指定語言
像是這樣就能切換成中文語音:
const synth = window.speechSynthesis;
const speak = (msg) => {
export default class fooModule { | |
constructor(){ | |
//.. | |
} | |
doSomeThing(){ | |
console.log("doSomeThing"); | |
} | |
} |
解決新版Twitter(2020年3月)對於外部網站點擊連結到含有敏感內容推文無法觀看的bug
利用瀏覽器的Referrer-Policy阻止來源網站的referrer送出
<a href="" rel="noreferrer">link</a>
// ==UserScript== | |
// @name meta-theme-color | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description add meta theme color | |
// @author Eotones | |
// @match https://term.ptt.cc/* | |
// @grant none | |
// ==/UserScript== |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Chat</title> | |
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,300' rel='stylesheet' type='text/css'> | |
<link href="style.css" rel="stylesheet" type="text/css"> | |
<script src="https://d2g2wobxbkulb1.cloudfront.net/0.0.19/tmi.js"></script> <!--For developement--> | |
<!--<script src="https://d2g2wobxbkulb1.cloudfront.net/0.0.19/tmi.min.js"></script>--> <!--For "production"--> | |
</head> |
!commands add !usd $(eval const n=parseFloat('$(query)');if(!isNaN(n)){const api = $(urlfetch json https://tw.rter.info/capi.php); api.error || (!api.USDTWD.Exrate) ? '查無資料' : `${n} USD = ${(n*api.USDTWD.Exrate).toFixed(2)} TWD (source: RTER)`;}else{'請在指令後面輸入數字'})
<?php | |
class Lunar | |
{ | |
const MIN_YEAR = 1891; | |
const MAX_YEAR = 2100; | |
const LUNAR_INFO = [ | |
[0, 2, 9, 21936], [6, 1, 30, 9656], [0, 2, 17, 9584], [0, 2, 6, 21168], [5, 1, 26, 43344], [0, 2, 13, 59728], | |
[0, 2, 2, 27296], [3, 1, 22, 44368], [0, 2, 10, 43856], [8, 1, 30, 19304], [0, 2, 19, 19168], [0, 2, 8, 42352], |