Skip to content

Instantly share code, notes, and snippets.

View crashmax-dev's full-sized avatar
:octocat:
Meow

Vitalij Ryndin crashmax-dev

:octocat:
Meow
  • Russia
  • 05:43 (UTC +08:00)
View GitHub Profile
@jpillora
jpillora / dijkstra.js
Last active July 17, 2022 17:53
Dijkstra's algorithm in JavaScript
//dijkstra solve graph starting at s
function solve(graph, s) {
var solutions = {};
solutions[s] = [];
solutions[s].dist = 0;
while(true) {
var parent = null;
var nearest = null;
var dist = Infinity;
@paulirish
paulirish / what-forces-layout.md
Last active November 15, 2024 16:45
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
@zmts
zmts / tokens.md
Last active November 18, 2024 13:13
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@Pulimet
Pulimet / AdbCommands
Last active November 18, 2024 14:20
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
App Description:
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups.
@Decicus
Decicus / README.md
Last active November 8, 2024 01:47
A userscript for displaying the actual date & time (relative to local time) of when a Twitch clip was created.

Twitch clip datetime userscript

A userscript for displaying the actual date & time (relative to local time) of when a Twitch clip (and video) was created.

FYI: It only works on URLs that start with https://clips.twitch.tv/.
This script does not work with URLs that are on the Twitch "channel pages" (https://www.twitch.tv/CHANNEL_NAME_HERE/clip/...).
This has been added as of v0.5.0.

"Under the hood" the script uses Date.toLocaleString() to format the date. The format of the date & time may differ from the screenshots below.

@mktwo
mktwo / YTLimiter.js
Last active July 21, 2023 09:39
A userscript that compresses YouTube audio so loud sections (such as intros that are at an average of 0dB when the video is at -6dB) aren't as awful.
// ==UserScript==
// @name YouTube Audio Compressor/Limiter
// @description A somewhat passable solution to YouTubers who don't know how to look at a dB meter while editing their videos... (Makes very loud sections not as deafening!)
// @author Tim (@ineedfocus)
// @include https://www.youtube.com/*
// @include http://www.youtube.com/*
// ==/UserScript==
//Apply compression to YouTube video
function fixAudio(element) {
@WebReflection
WebReflection / dom-libraries.md
Last active October 29, 2024 07:54
A recap of my FE / DOM related libraries

My FE/DOM Libraries

a gist to recap the current status, also available as library picker!

Minimalistic Libraries

do one thing only and do it well

  • µhtml (HTML/SVG auto-keyed and manual keyed render)
  • augmentor (hooks for anything)
  • wickedElements (custom elements without custom elements ... wait, what?)
@bhagman
bhagman / YTMVolumeFix.user.js
Last active October 24, 2023 16:02
YouTube Music Volume Fix
// ==UserScript==
// @name YouTube Music Volume Fix
// @author Brett Hagman
// @namespace https://gist.github.com/bhagman/f3043b28fa6bdf6a630bb192a8bf4a37
// @version 1.0.0
// @description Changes YTM volume slider to change based on a curve more suited to human hearing.
// @match https://music.youtube.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
@sindresorhus
sindresorhus / esm-package.md
Last active November 17, 2024 22:07
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.