<form id='myContactForm' action='https://cohan.me/that-needs-js/'
data-action='https://cohan.me/your/actual/form/submit/url'>
<script>
function updateContactFormDestination() {
var contactForm = document.getElementById("myContactForm");
var realSubmitUrl = contactForm.getAttribute('data-action');
contactForm.setAttribute('action', realSubmitUrl);
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
interface Action<T> { | |
payload?: T; | |
type: string; | |
} | |
class EffectModule { | |
count = 1; | |
message = "hello!"; | |
delay(input: Promise<number>) { |
- windows
set GIT_SSL_NO_VERIFY=true git clone
- linux
env GIT_SSL_NO_VERIFY=true git push
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
image: node:4.2.2 | |
cache: | |
paths: | |
- node_modules/ | |
stages: | |
- test | |
test_async: |
lsof -i :端口
kill -9 进程ID
solution:
This is actually a macOS Gatekeeper issue try these steps:
To resolute Gatekeeper issues on macOS Sierra you might have to partially or completely disable Gatekeeper checks.
- Option I, For a certain application run in Terminal:
支持esm的浏览器我们可以不polyfill,反之我们才需要polyfill。 我们构建的时候需要打两份,如果将来规则更加细化,我们可以做到更加细致。当然这个东西可以做成服务化,类似polyfill.io
- build 两次,而且只在 build 阶段做,可以用 webpack 的多配置,也可以多 webpack 实例
- mjs 格式配 babel-preset-env 的 targets.esmodules 为 true
- HTML部分
<script type="module" src="bundle.mjs"></script>
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
window.addEventListener('pointermove', event => { | |
const events = event.getCoalescedEvents(); | |
for (let event of events) { | |
const x = event.pageX; | |
const y = event.pageY; | |
// draw a line using x and y coordinates. | |
} | |
}); | |
- 更新之前 - getSelectionInformation
- 更新之后 - restoreSelection
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
function check_webp_feature(feature, callback) { | |
var kTestImages = { | |
lossy: "UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", | |
lossless: "UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==", | |
alpha: "UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==", | |
animation: "UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA" | |
}; | |
var img = new Image(); | |
img.onload = function () { | |
var result = (img.width > 0) && (img.height > 0); |