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
# fork your own repo, example of my repo https://github.com/vadimkantorov/eventmap | |
git clone [email protected]:vadimkantorov/eventmapexample.git | |
cd eventmapexample | |
git remote add upstream [email protected]:vadimkantorov/eventmap.git | |
git pull upstream gh-pages | |
git checkout gh-pages | |
git push -u origin gh-pages | |
# update git to latest version on ubuntu | |
sudo add-apt-repository -y ppa:git-core/ppa |
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
# git clone --branch v0.4 --depth 1 --single-branch https://github.com/pmaupin/pdfrw | |
# PYTHONPATH="$PWD/pdfrw:$PYTHONPATH" python3 safepdfmerge.py /path/to/target/dir /path/to/my/file1.pdf /path/to/my/file2.pdf /paths/to/other/files.pdf | |
import sys, os, pdfrw; safe_read_pdf_pages = lambda path: exec(f"try: res = pdfrw.PdfReader({path!r}).pages;\nexcept: print({path!r}, sys.exc_info()); res = []", globals(), globals()) or res; writer = pdfrw.PdfWriter(); [writer.addpages(safe_read_pdf_pages(inpfn)) for inpfn in sys.argv[2:]]; os.makedirs(sys.argv[1], exist_ok = True); writer.write(os.path.join(sys.argv[1], os.path.basename(sys.argv[2]))) |
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
# download only auto subtitles, resources: | |
# https://superuser.com/questions/927523/how-to-download-only-subtitles-of-videos-using-youtube-dl | |
# http://ytdl-org.github.io/youtube-dl/download.html | |
# wget https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe && ./vcredist_x86.exe /install /quiet /norestart | |
# wget https://yt-dl.org/downloads/latest/youtube-dl.exe | |
# downloadonlysubtitles ru 'https://www.youtube.com/watch?v=VBHhhGOGdKk' | |
alias downloadonlysubtitles='youtube-dl --skip-download --write-auto-sub --sub-lang' # or ./youtube-dl.exe on Windows |
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
# cat foo.html | python heb.py | |
# https://en.wikipedia.org/wiki/Hebrew_(Unicode_block) | |
import re, sys; print('\n'.join(filter(bool, map(str.strip, re.findall(u'[ \u0590-\u05ff]+', sys.stdin.read()))))) |
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
rem diskpart /s attach_virtualusb.diskpart | |
select vdisk file=C:\Users\vadim\virtualusb.vhd | |
attach vdisk | |
assign letter=B |
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
# Usage: using Chrome DevConsole's Network tab, grab JWT token from a manual search of rdv at https://myvisit.com (found in Authorization/Cookie header of /CentralAPI/SearchAvailableDates call) and call as: | |
# python3 poia_rdv_myvisit.py --jwt 'eyJ...' | |
# this jwt token is a result of recaptcha solution and is valid for 30 min | |
# found existing service to pick the rdv times for passport renewal: https://picktimebot.com/, Chrome extension to collect the JWT token: https://github.com/SharonBrizinov/PickTime | |
# klita currently fails LocationSearch request, so duplicates are fetched from crawled services.json | |
# -*- coding: utf-8 -*- | |
import argparse | |
import json | |
import time |
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
shcore.dll | |
ntoskrnl.exe!KeSynchronizeExecution+0x6776 | |
ntoskrnl.exe!KeLowerIrql+0x16d7 | |
ntoskrnl.exe!KeLowerIrql+0x3589 | |
ntoskrnl.exe!KeWaitForSingleObject+0x234 | |
ntoskrnl.exe!KeQuerySystemTimePrecise+0x131b | |
ntoskrnl.exe!RtlFindClearBits+0x1634 | |
ntoskrnl.exe!KeLowerIrql+0x1c66 | |
ntoskrnl.exe!KeLowerIrql+0x3589 |
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
# Instance-Aware, Context-Focused, and Memory-Efficient Weakly Supervised Object Detection, https://arxiv.org/abs/2004.04725 | |
# https://github.com/NVlabs/wetectron/issues/72 | |
# https://discuss.pytorch.org/t/mini-batching-gradient-accumulation-within-the-model/136460 | |
import torch | |
import torch.nn as nn | |
class SequentialBackprop(nn.Module): | |
def __init__(self, module, batch_size = 1): | |
super().__init__() |
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 torch | |
import torch.nn.functional as F | |
import torchvision | |
import base64 | |
gather_incomplete = lambda tensor, I: tensor.gather(I.ndim, I[(...,) + (None,) * (tensor.ndim - I.ndim)].expand((-1,) * (I.ndim + 1) + tensor.shape[I.ndim + 1:])).squeeze(I.ndim) | |
expand_dim = lambda tensor, expand, dim: tensor.unsqueeze(dim).expand((-1, ) * (dim if dim >= 0 else tensor.ndim + dim + 1) + (expand, ) + (-1, ) * (tensor.ndim - (dim if dim >= 0 else tensor.ndim + dim + 1))) | |
encode_image_as_html = lambda img, height, width: '<img height="{height}" width="{width}" src="data:image/jpeg;base64,{encoded}" />'.format(height = height, width = width, encoded = bytes(base64.b64encode(torchvision.io.encode_jpeg(F.interpolate(img[None], (height, width)).squeeze(0)))).decode()) |
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
# Blender 2.93 python script for producing images like in https://github.com/facebookresearch/meshrcnn/issues/22 | |
# blender -noaudio --background --python meshrcnn_overlay_mesh.py -- --object-path test.obj --background-path test.png | |
# | |
# Sample ouptut: | |
# https://github.com/facebookresearch/meshrcnn/issues/100 | |
# | |
# References: | |
# https://github.com/yuki-koyama/blender-cli-rendering/blob/master/02_suzanne.py | |
# https://github.com/weiaicunzai/blender_shapenet_render/blob/master/render_rgb.py | |
# https://towardsdatascience.com/blender-2-8-grease-pencil-scripting-and-generative-art-cbbfd3967590 |