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
| var saving_playlist = window.location.href.includes('/playlist?list=') | |
| var all_contents = | |
| saving_playlist ? | |
| document.querySelectorAll('div#contents > ytd-playlist-video-renderer > div#content > div#container > div#meta') | |
| : | |
| document.querySelectorAll("#content > yt-lockup-view-model > div > div > yt-lockup-metadata-view-model") | |
| var format = '.txt' |
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
| import numpy | |
| import cv2 | |
| import sys | |
| import datetime | |
| background = numpy.full((1080, 1920, 3), (0, 216, 255), numpy.uint8) | |
| background_w, background_h = background.shape[1], background.shape[0] | |
| cap = cv2.VideoCapture(sys.argv[1]) | |
| count = 0 |
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
| // ==UserScript== | |
| // @name 4ChReplies (Improve Replies) | |
| // @namespace 4ChReplies | |
| // @version 1.0 | |
| // @description Make navigate on 4chan replies more comfortable with this script for tampermonkey. Now replies closes only by click on it. | |
| // @author https://github.com/evdokimovm | |
| // @match https://boards.4chan.org/* | |
| // @match https://boards.4channel.org/* | |
| // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
| // @grant none |
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
| #!/usr/bin/env python3 | |
| # FIXME: requirements.txt | |
| # pip3 install python-telegram-bot --upgrade | |
| # pip3 install pyscreenshot | |
| # pip3 install pillow | |
| from telegram.ext import Updater | |
| from telegram.ext import CommandHandler |
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
| // Get nth byte of integer | |
| // https://stackoverflow.com/a/7787433/5526354 | |
| int x = (number >> (8*n)) & 0xff; |
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
| # Get octal file permissions number | |
| # https://www.cyberciti.biz/faq/get-octal-file-permissions-from-command-line-on-linuxunix/ | |
| stat -c '%a' /etc/passwd |
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
| ls | grep "png" | xargs -d "\n" cp -t $target_dir |
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
| def euclidean_distance(pt1, pt2): | |
| distance = 0 | |
| for i in range(len(pt1)): | |
| distance += (pt1[i] - pt2[i]) ** 2 | |
| return distance ** 0.5 | |
| def manhattan_distance(pt1, pt2): | |
| distance = 0 | |
| for i in range(len(pt1)): | |
| distance += abs(pt1[i] - pt2[i]) |
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
| def euclidean_distance(pt1, pt2): | |
| distance = 0 | |
| for i in range(len(pt1)): | |
| distance += (pt1[i] - pt2[i]) ** 2 | |
| return distance ** 0.5 | |
| print(euclidean_distance([1, 2], [4, 0])) | |
| print(euclidean_distance([5, 4, 3], [1, 7, 9])) |
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
| // Usage: $form.find('input[type="checkbox"]').shiftSelectable(); | |
| // replace input[type="checkbox"] with the selector to match your list of checkboxes | |
| $.fn.shiftSelectable = function() { | |
| var lastChecked, | |
| $boxes = this; | |
| $boxes.click(function(evt) { | |
| if(!lastChecked) { | |
| lastChecked = this; |