Skip to content

Instantly share code, notes, and snippets.

View uqe's full-sized avatar
:shipit:
Focusing

Arthur Nizamov uqe

:shipit:
Focusing
View GitHub Profile
@uqe
uqe / extract_telegram_macos.ipynb
Created October 27, 2024 20:39 — forked from stek29/extract_telegram_macos.ipynb
Extract Telegram messages from db_sqlite PostBox – made for Telegram for macOS, but should work with Telegram for iOS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uqe
uqe / dom3d.js
Created August 6, 2024 19:49 — forked from OrionReed/dom3d.js
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@uqe
uqe / script.js
Created July 29, 2024 03:43 — forked from gd3kr/script.js
Download a JSON List of twitter bookmarks
/*
the twitter api is stupid. it is stupid and bad and expensive. hence, this.
Literally just paste this in the JS console on the bookmarks tab and the script will automatically scroll to the bottom of your bookmarks and keep a track of them as it goes.
When finished, it downloads a JSON file containing the raw text content of every bookmark.
for now it stores just the text inside the tweet itself, but if you're reading this why don't you go ahead and try to also store other information (author, tweetLink, pictures, everything). come on. do it. please?
*/
@uqe
uqe / smartLevenshteinDistance.ts
Created July 5, 2024 15:11 — forked from titsex/smartLevenshteinDistance.ts
A slightly smarter Levenshtein distance.
interface KEYBOARD {
[key: string]: string[]
}
const NEARBY_CHARACTER_MAP: KEYBOARD = {
'q': ['w', 'a', '1', '2'],
'w': ['q', 'e', 'a', 's', '2', '3'],
'e': ['w', 'r', 's', 'd', '3', '4'],
'r': ['e', 't', 'd', 'f', '4', '5'],
't': ['r', 'y', 'f', 'g', '5', '6'],
@uqe
uqe / gist:4ba751cad7cba9a34079381b449b5134
Created April 26, 2021 03:44 — forked from g3d/gist:2709563
Clean Install – OS X 10.11 El Capitan
@uqe
uqe / unwrap-shorthands-css.js
Created August 29, 2020 20:48 — forked from sergeysova/unwrap-shorthands-css.js
Unwrap CSS shorthands
function getLonghands(property) {
const element = document.createElement('div');
const style = element.style;
style[property] = "inherit";
const ret = [...style];
style.cssText = "";
return ret;
}
@uqe
uqe / what-forces-layout.md
Created July 30, 2020 14:34 — 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
import React from 'react'
type Options<T> = {
element: T
ratio?: number
getBoundingClientRect?: (
element: T,
) => ReturnType<HTMLElement['getBoundingClientRect']>
getTransformMove?: (transform: string) => string
getTransformLeave?: () => string

ffmpeg tips

Examples

Download HLS to file

ffmpeg -i input.m3u8 -c copy -bsf:a aac_adtstoasc output.mp4

Capture screen on X11

ffmpeg -f x11grab -s 1920x1080 -r 30 -i :0.0+0,0 output.mp4