Skip to content

Instantly share code, notes, and snippets.

View nezort11's full-sized avatar

Yegor Zorin nezort11

View GitHub Profile
@nezort11
nezort11 / run.sh
Last active January 9, 2024 08:52
Bash script to execute script from package.json without package manager (npm run, yarn, pnpm) or node_modules installed.
#!/usr/bin/env bash
PACKAGE_FILE="package.json"
PACKAGE_RUN_COMMAND="npm"
RUN_COMMAND="bash ${0}"
SCRIPT="$1"
# Check package manager
if [ -f "package-lock.json" ]; then
PACKAGE_RUN_COMMAND="npm"
@kurumigi
kurumigi / youtube_format_code_itag_list.md
Last active June 11, 2023 20:08 — forked from sidneys/youtube_format_code_itag_list.md
YouTube video stream format codes itags

YouTube video stream format codes

Comprehensive list of YouTube format code itags

itag Code Container Content Resolution Bitrate Range VR / 3D
5 flv audio/video 240p - - -
6 flv audio/video 270p - - -
17 3gp audio/video 144p - - -
18 mp4 audio/video 360p - - -
22 mp4 audio/video 720p - - -
@MrChocolatine
MrChocolatine / TS - More precise return type method Date#toISOString.d.ts
Last active August 22, 2024 09:31
TypeScript – How to accurately type dates in ISO 8601 format
// In TS, interfaces are "open" and can be extended
interface Date {
/**
* Give a more precise return type to the method `toISOString()`:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
*/
toISOString(): TDateISO;
}
type TYear = `${number}${number}${number}${number}`;
@jordienr
jordienr / Gradient.js
Created September 12, 2021 00:23
Stripe Mesh Gradient WebGL
/*
* Stripe WebGl Gradient Animation
* All Credits to Stripe.com
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and
* commented out for now.
* https://kevinhufnagl.com
*/
/**
* Converts an ArrayBuffer to a String.
*
* @param buffer - Buffer to convert.
* @returns String.
*/
export default function arrayBufferToString(buffer: ArrayBuffer): string {
return String.fromCharCode.apply(null, Array.from(new Uint16Array(buffer)));
}
@thaJeztah
thaJeztah / README.md
Last active February 8, 2023 19:38
Docker Compose as a Docker CLI plugin

Run Docker Compose as a Docker CLI plugin

Just a quick fun experiment to try to make docker-compose work as a Docker CLI plugin

To use it (assuming you have docker compose installed):

  1. download a and install nightly build of the docker cli (linux macOS)
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active September 22, 2024 00:31
Conventional Commits Cheatsheet

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@rambabusaravanan
rambabusaravanan / detect-js-framework.js
Last active September 14, 2024 03:06
Detect JS Framework used in a Website
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I)
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]') ||
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer')))
)
console.log('React.js');
if(!!document.querySelector('script[id=__NEXT_DATA__]'))
console.log('Next.js');
@staltz
staltz / introrx.md
Last active September 20, 2024 10:10
The introduction to Reactive Programming you've been missing