Skip to content

Instantly share code, notes, and snippets.

View okvv's full-sized avatar
🎯
Focusing

Vladimir Okun okvv

🎯
Focusing
View GitHub Profile
@okvv
okvv / decrypt-pdf.sh
Last active July 10, 2023 11:27
bash script to bulk remove password from (pdf) files in current directory using qpdf
#!/usr/bin/env bash
for f in *
do qpdf --password=THE_PASSWORD --decrypt --replace-input $f;
done
# brew install qpdf
# for executable file run: chmod u+x decrypt-pdf.sh
# merge files into one PDF: `qpdf --empty --pages *.pdf -- out.pdf`
@okvv
okvv / what-forces-layout.md
Created May 30, 2022 14:52 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@okvv
okvv / mockup.md
Created May 30, 2022 14:50 — forked from morsdyce/mockup.md
Timer App

Timer App

Please create an app for managing timed tasks.

  1. The user can input a text and click Add
  2. A new task is added with the title, and 00:00 time, and a play button.
  3. Clicking Play will play this task: the timer will start running, and the icon will change to a pause icon. Also - any other running task will be paused.
  4. Clicking Pause will pause the task.
  5. The total time is always updated.
@okvv
okvv / VirtualScrollTable.js
Created January 21, 2020 00:28
VirtualScrollTable
import React, {
memo,
useMemo,
useRef,
useState,
useEffect,
useCallback
} from "react";
import { Link } from "react-router-dom";