$ docker stop $(docker ps -q)
$ cd /path/to/Dockerfile
// Execute this in the console of on your own playlist | |
var videos = document.querySelectorAll('.yt-simple-endpoint.style-scope.ytd-playlist-video-renderer'); | |
var r = []; | |
var json = []; | |
r.forEach.call(videos, function(video) { | |
var url = 'https://www.youtube.com' + video.getAttribute('href'); | |
url = url.split('&list=WL&index='); | |
url = url[0]; |
var string_to_slug = function (str) | |
{ | |
str = str.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
var from = "àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/_,:;"; | |
var to = "aaaaeeeeiiiioooouuuuncescrzyuudtn------"; | |
for (var i=0, l=from.length ; i<l ; i++) |
# Backup files | |
#https://explainshell.com/explain?cmd=rsync+-azuv+--delete+--progress+--exclude+%27node_modules%27 | |
rsync -auvhp --delete --exclude=node_modules [source] [destination] | |
# Remove all node_modules folders | |
# https://explainshell.com/explain?cmd=find+.+-name+%22node_modules%22+-type+d+-prune+-exec+rm+-rf+%27%7B%7D%27+%2B | |
find . -name "node_modules" -type d -prune -exec rm -rf '{}' + |
.sidebar_newsletter_sign_up, | |
.sidebar_subscribe, | |
.sign-up-form-single, | |
.signup-form--header, | |
.signup-with-checkboxes, | |
.skinny-sign-up, | |
.slidedown-newsletter, | |
.small-newsletter, | |
.social-link-mail, | |
.social_newsletter_box, |
The package linked to from here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
import foo from 'foo'
instead of const foo = require('foo')
to import the package. You also need to put "type": "module"
in your package.json and more. Follow the below guide.await import(…)
from CommonJS instead of require(…)
.#!/usr/bin/env bash | |
# Download all images listed in list.txt then make it a PDF | |
wget --input list.txt -O $1.jpg | |
convert *.jpg output.pdf |
# source: https://docs.nextcloud.com/server/19/user_manual/files/access_webdav.html#accessing-files-using-curl | |
curl -u USERNAME:PASSWORD -T /path/to/file https://my.nextcloud.tld/remote.php/dav/files/USERNAME/path/to/directory/ |
// Math.random() will give you a random decimal number between 0 and 1 | |
// Just check if the number is greater than 0.5 | |
// And apply -1 or 1 depending on the result | |
Math.random() < 0.5 ? -1 : 1; | |
// Math.random() will give you a random decimal number between 0 and 1 | |
// Math.rand() of a Math.random() will give you an integer 0 or 1 | |
// Use 0 or 1 as a result of a condition to use -1 or 1 | |
Math.round(Math.random()) ? -1 : 1; | |
// /!\ NOTE : Can be used for any other values like 9 or 37 ; -2 or 2... |