Skip to content

Instantly share code, notes, and snippets.

View nikolay-borzov's full-sized avatar
💀
in search of meaning

Nikolay Borzov nikolay-borzov

💀
in search of meaning
  • Saratov, Russia
  • 03:22 (UTC +04:00)
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active July 23, 2024 10:30
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.
@tomhicks
tomhicks / plink-plonk.js
Last active July 22, 2024 09:51
Listen to your web pages
@ni554n
ni554n / gif_to_webm.bat
Last active February 3, 2024 21:15
Convert a folder of GIFs to WEBM with FFMPEG.
@ECHO off
ECHO :: GIF to WEBM Converter ::
ECHO ---------------------------
:: Replace this ffmpeg variable value with your own ffmpeg.exe path.
SET ffmpeg=%USERPROFILE%\Programs\JDownloader\tools\Windows\ffmpeg\x64\ffmpeg.exe
SET command=%ffmpeg% -i "%%f" -c:v libvpx-vp9 -b:v 0 -crf 30 -an -f webm -passlogfile "%TEMP%\ffmpeg2pass.log"
SET /P folder="Input directory path: "
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@MichalZalecki
MichalZalecki / index.js
Created March 12, 2016 12:24
How to import RxJS 5
// Import all
import Rx from "rxjs/Rx";
Rx.Observable
.interval(200)
.take(9)
.map(x => x + "!!!")
.bufferCount(2)
.subscribe(::console.log);
@fhfaa
fhfaa / CustomRules.js
Last active September 8, 2023 16:46
CORS ALL the things in Fiddler2
import System;
import System.Windows.Forms;
import Fiddler;
// INTRODUCTION
//
// Well, hello there!
//
// Don't be scared! :-)
//
@pafnuty
pafnuty / declination.js
Last active June 9, 2019 15:02
Склонение русских слов на javascript и php с идентичной реализацией передачи параметров
/**
* Функция для склонения русских слов
* Пример использования: ruDeclination(5,'комментари|й|я|ев')
*
* @author Павел Белоусов <pafnuty10@gmail.com>
*
* @param {number} number Число, для которого будет расчитано окончание
* @param {string} words Слово и варианты окончаний для 1|2|1 (1 комментарий, 2 комментария, 100 комментариев)
* @return {string} Cлово с правильным окончанием
*/
@alexbevi
alexbevi / Execute-With-Retry.ps1
Created February 6, 2015 15:28
A PowerShell cmdlet that can be used to retry a failing ScriptBlock
<#
This function can be used to pass a ScriptBlock (closure) to be executed and returned.
The operation retried a few times on failure, and if the maximum threshold is surpassed, the operation fails completely.
Params:
Command - The ScriptBlock to be executed
RetryDelay - Number (in seconds) to wait between retries
(default: 5)
MaxRetries - Number of times to retry before accepting failure
@neilj
neilj / gist:1532562
Created December 29, 2011 07:22
Sugared DOM: Better Than Templates
var el = ( function () {
var doc = document;
var directProperties = {
'class': 'className',
className: 'className',
defaultValue: 'defaultValue',
'for': 'htmlFor',
html: 'innerHTML',