This file contains 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 argparse | |
from typing import List | |
class SmartFormatter(argparse.HelpFormatter): | |
def _split_lines(self, text: str, width: int) -> List[str]: | |
lines: List[str] = [] | |
for line_str in text.split('\n'): | |
line: List[str] = [] | |
line_len = 0 | |
for word in line_str.split(): |
This file contains 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
from PIL import Image | |
import numpy as np | |
import cv2 | |
def pil2cv(image: Image) -> np.ndarray: | |
mode = image.mode | |
new_image: np.ndarray | |
if mode == '1': | |
new_image = np.array(image, dtype=np.uint8) |
This file contains 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
javascript:(function() { | |
function screenshot(video) { | |
var canvas = document.createElement('canvas'); | |
canvas.width = video.videoWidth; | |
canvas.height = video.videoHeight; | |
context = canvas.getContext('2d'); | |
var now = new Date(); | |
context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight); | |
var url = canvas.toDataURL('image/png'); | |
var link = document.createElement('a'); |
This file contains 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
(function() { | |
"use strict"; | |
function padd(x) { | |
var x = String(x); | |
return x.length < 2 ? '0' + x : x; | |
} | |
var duration = +document.querySelector("video").duration; | |
var playerData = document.querySelector("ytd-watch-flexy").__data.playerData; |
This file contains 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/bash | |
input=/dev/stdin | |
output=/dev/stdout | |
slice= | |
palette="/tmp/mkgif-$$-palette.png" | |
fps=15 | |
width= | |
crop= |
This file contains 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
javascript:(()=>{var d=document.documentElement,b=document.body,es=b.querySelectorAll("*"),m=20;for(var i=0;i<es.length;++i){var e=es[i];var s=getComputedStyle(e);if(s.position!=='static'&&s.position!=='relative'){var r=e.getBoundingClientRect();if(r.x<=m&&r.y<=m&&r.right>=window.innerWidth - m&&r.bottom>=window.innerHeight - m){e.remove();}}}var s='\n/**/;position:static!important;overflow:auto!important;width:auto!important;height:auto!important;';d.setAttribute('style',(d.getAttribute('style')||'')+ s);b.setAttribute('style',(b.getAttribute('style')||'')+ s);})();void(0) |
This file contains 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
// Show Passwords: | |
javascript:document.querySelectorAll('input[type=password]').forEach(e=>{e.type='text';e.setAttribute('data-io-github-panzi-password','true');});void(0) | |
// Hide Passwords again: | |
javascript:document.querySelectorAll('input[data-io-github-panzi-password=true]').forEach(e=>e.type='password');void(0) |
This file contains 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
#!/bin/bash | |
set -e | |
SUBDIRECTORY_OK=1 | |
. "`git --exec-path`/git-sh-setup" | |
cd_to_toplevel | |
O=".git-kmerge3-tmp-$$" | |
list=$O/.git-kmerge3-list |
This file contains 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 | |
import mysql.connector | |
import argparse | |
import csv | |
import re | |
import sys | |
from contextlib import closing | |
from os import makedirs | |
from os.path import join as join_path |