Browser support MDN
- ✅ Chrome 64 & Edge 79
- ✅ Safari 11.1
- ✅ Firefox 78
- ✅ nodejs: 10.0
- ✅ babel
addEventListener('fetch', event => { | |
event.respondWith(fetchAndApply(event.request)) | |
}) | |
async function fetchAndApply(request) { | |
let response = await fetch(request) | |
let referer = request.headers.get('Referer') | |
let contentType = response.headers.get('Content-Type') || '' | |
if (referer && contentType.startsWith('image/')) { |
2019 update: this essay has been updated on my personal site, together with a followup on how to get started
2020 update: I'm now writing a book with updated versions of all these essays and 35 other chapters!!!!
If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.
You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |
make sure the following lines are set in /etc/sshd_config (or /etc/ssh/sshd_config on ubuntu) | |
(they all exist already, but are commented, some may have a value of yes) | |
PasswordAuthentication no | |
ChallengeResponseAuthentication no | |
UsePAM no | |
then restart the ssh server (uncheck / recheck 'Remote Login' in the 'System Preferences' -> 'Sharing' panel) |