AddOn:
- Go to
about:support
in your address bar - Look for your profiles directory and open it:
- Create a file named
chrome/userChrome.css
in your profile directory and populate the following css code
(async () => { | |
const buttons = document.querySelectorAll( | |
'button.style-scope.yt-icon-button[aria-label="Action menu"]' | |
); | |
for (const button of buttons) { | |
try { | |
button.click(); | |
await new Promise(r => setTimeout(r, 200)); | |
const item = [...document.querySelectorAll("ytd-menu-service-item-renderer")].find(el => el.textContent.includes("Remove from Watch Later")); |
# How to fully uninstall Logitech G HUB on macOS via terminal/command line | |
# Tested on macOS version 12.3.1 (21E258) Monterey in April 2022 | |
# with Logitech G HUB version 2022.3.242300 (released on 2022-03-22) installed. | |
# 1. Make sure "Logitech G HUB" itself is not running. If it is, quit it. | |
# 2. Open "Activity Monitor" and force-quit all processes named "lghub*". | |
# 3. Delete system-wide files | |
sudo rm -rf /Applications/lghub.app |
#!/usr/bin/env bash | |
# Script that erases pipelines from GitLab | |
GITLAB_TOKEN="" # <required> | |
PROJECT_ID="" # <required> | |
GITLAB_INSTANCE="https://gitlab.com/api/v4/projects" # <required> | |
PER_PAGE="" # [optional] if not specified script will run once per page | |
for PIPELINE in $(curl --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "$GITLAB_INSTANCE/$PROJECT_ID/pipelines?per_page=$PER_PAGE&sort=asc" | jq .[].id) ; do |
AddOn:
about:support
in your address barchrome/userChrome.css
in your profile directory and populate the following css code// If A extends B, does it mean that Type<A> extends Type<B>? | |
// | |
// An example that shows broken type variance in TypeScript. | |
// Following code compiles, but it shouldn't. | |
// It also doesn't fail at runtime because there are example classes | |
// with no methos, but real-world classes would use wrong methos and fail at runtime. | |
// Let's pretend there are unique methos for each class | |
abstract class Animal {} |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Optional; | |
import java.util.function.Supplier; | |
/** | |
* Usage example: | |
* {@code (int) new Matcher(5).matchCase(1, () -> 1).defaultCase(() -> 5)} | |
*/ | |
public class Matcher<V, R> { |
local opts = { noremap = true, silent = true } | |
local expr = { noremap = true, silent = true, expr = true } | |
-- Center screen on the "next" and "previos" search jumps | |
vim.api.nvim_set_keymap("n", "n", "nzzzv", opts) | |
vim.api.nvim_set_keymap("n", "N", "Nzzzv", opts) | |
-- Move one or more selected lines up and down (in Visual mode) | |
vim.api.nvim_set_keymap("v", "J", ":m '>+1<CR>gv=gv", opts) | |
vim.api.nvim_set_keymap("v", "K", ":m '<-2<CR>gv=gv", opts) |
import java.io.BufferedReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.util.stream.Collector; | |
public class H13_5 { |
/** | |
* Compares arrays with shifted values. | |
* | |
* @example | |
* // returns 3 | |
* compareShifted([1, 2, 3, 4], [4, 1, 2, 3]); | |
* @example | |
* // returns -1 | |
* compareShifted([1, 2, 3, 4], [1, 2, 4, 3]); | |
* @example |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user