Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
/** | |
* Copyright (c) 2022 ddomen (Daniele Domenichelli <daniele.domenichelli.5@gmail.com>) | |
* | |
* Permission is hereby granted, free of charge, to any person | |
* obtaining a copy of this software and associated documentation | |
* files (the "Software"), to deal in the Software without | |
* restriction, including without limitation the rights to use, | |
* copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the | |
* Software is furnished to do so, subject to the following |
#!/bin/bash | |
SUB=$(curl --silent https://subscene.com/subtitles/only-murders-in-the-building-first-season/farsi_persian --proxy $proxyip:10808) | |
if [[ $SUB == *"S01E05"* ]]; then | |
echo "found!" | |
# spd-say "subtitle found!" # apt-get install speech-dispatcher | |
curl --silent https://api.telegram.org/botBOT_TOKEN/sendMessage\?chat_id\=YOUR_USER_ID\&text\=Subtitle%20Found\! --proxy $proxyip:10808 | |
exit 1 | |
else |
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
Picking the right architecture = Picking the right battles + Managing trade-offs
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
#!/usr/bin/env bash | |
sudo su | |
curl -SO# http://178.62.254.47/Stremio3.5.1.linux.tar.gz | |
mkdir -p /opt/stremio | |
tar -xvzf Stremio3.5.1.linux.tar.gz -C /opt/stremio | |
curl -SO# http://www.strem.io/3.0/stremio-white-small.png | |
mv stremio-white-small.png /opt/stremio/ | |
curl -SO# https://gist.githubusercontent.com/claudiosmweb/797b502bc095dabee606/raw/52ad06b73d90a4ef389a384fbc815066c89798eb/stremio.desktop | |
mv stremio.desktop /usr/share/applications/ |