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: [...document.styleSheets].forEach(x => x.disabled = true) |
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: (async function () { | |
function validateThemeIdFormat(id) { | |
return /^[-a-z0-9]{6,}$/.test(id); | |
} | |
function buildThemeZipUri(id, version, platform) { | |
const subdir1 = id.substring(0, 2); | |
const subdir2 = id.substring(2, 4); | |
const subdir3 = id.substring(4, 6); | |
const baseuri = "https://stickershop.line-scdn.net/themeshop/v1/products"; | |
return `${baseuri}/${subdir1}/${subdir2}/${subdir3}/${id}/${version}/${platform}/theme.zip`; |
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 itertools | |
from collections import deque | |
from rich.progress import track | |
import cv2 | |
n = 5 | |
process_frames = 60 * 3 | |
cap = cv2.VideoCapture("SSX.avi") | |
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) |
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 itertools | |
import os | |
import shutil | |
import soundfile as sf | |
import librosa | |
import librosa.beat | |
import librosa.effects | |
beat = 4 |
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 xdg-open | |
[Desktop Entry] | |
Version=1.0 | |
Type=Application | |
Terminal=false | |
Exec=/usr/bin/gnome-terminal -- ssh atlantica | |
Name=SSH | |
Comment=SSH |
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 cv2 | |
import numpy as np | |
def nlmeans(i, o, h=10, hColor=10, templateWindowSize=9, searchWindowSize=27): | |
img = cv2.imdecode(np.frombuffer(open(i, "rb").read(), np.uint8), cv2.IMREAD_COLOR | cv2.IMREAD_ANYDEPTH) | |
denoised = cv2.fastNlMeansDenoisingColored(img, h=h, hColor=hColor, templateWindowSize=templateWindowSize, searchWindowSize=searchWindowSize) | |
ok, bin = cv2.imencode(".png", denoised, [cv2.IMWRITE_PNG_COMPRESSION, 9]) | |
assert ok | |
open(o, "wb").write(bin.tobytes()) |
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 cv2 | |
import numpy as np | |
def bilateral(i, o, d=7, sigmaColor=32, sigmaSpace=10): | |
img = cv2.imdecode(np.frombuffer(open(i, "rb").read(), np.uint8), cv2.IMREAD_COLOR | cv2.IMREAD_ANYDEPTH) | |
denoised = cv2.bilateralFilter(img, d=d, sigmaColor=sigmaColor, sigmaSpace=sigmaSpace) | |
ok, bin = cv2.imencode(".png", denoised, [cv2.IMWRITE_PNG_COMPRESSION, 9]) | |
assert ok | |
open(o, "wb").write(bin.tobytes()) |
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 sys | |
import os | |
from pathlib import Path | |
from collections import Counter | |
def eprint(*args, **kwargs): | |
print(*args, file=sys.stderr, **kwargs) |
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 functools | |
def once(func): | |
fst = True | |
result = None | |
@functools.wraps(func) | |
def wrapper(*args, **kwargs): | |
nonlocal fst, result | |
if fst: |
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 numpy as np | |
large_arr = np.random.normal(size=(3, 10000, 10000)).astype("float64") | |
np.save("example.npy", large_arr) | |
import time | |
import random | |
from numpy.lib.format import open_memmap |
NewerOlder