Skip to content

Instantly share code, notes, and snippets.

View voznik's full-sized avatar
🤔
Open for opportunities

Vadym Parakonnyi voznik

🤔
Open for opportunities
View GitHub Profile
@rishitells
rishitells / Jest_GitLab_CI.md
Last active December 25, 2024 22:21
Setting up Jest tests and coverage in GitLab CI

Configuring Jest Tests in GitLab CI

1. Add GitLab CI configuration file in the root

In the root of your project, add .gitlab-ci.yml with the configuration below.

image: node:latest

stages:
@ef4
ef4 / examples.md
Last active January 29, 2025 20:54
Webpack 5 Node Polyfills Upgrade Cheatsheet

Webpack 5 Node Polyfills Upgrade Cheatsheet

Webpack 4 automatically polyfilled many Node APIs in the browser. This was not a great system, because it could lead to surprisingly giant libraries getting pulled into your app by accident, and it gave you no control over the exact versions of the polyfills you were using.

So Webpack 5 removed this functionality. That means you need to make changes if you were relying on those polyfills. This is a quick reference for how to replace the most common patterns.

List of polyfill packages that were used in webpack 4

For each automatically-polyfilled node package name on the left, this shows the name of the NPM package that was used to polyfill it on the right. Under webpack 5 you can manually install these packages and use them via resolve.fallback.

@ullaskunder3
ullaskunder3 / README.md
Last active December 25, 2024 13:37
Detail flutter installation without android studio just using cmdline-tools, git, cmd
@leoek
leoek / xps15fingerprint.sh
Created April 8, 2021 14:48 — forked from stefanovazzocell/xps15fingerprint.sh
Ubuntu / PopOS Fingerprint Support - Dell XPS 15 9500
#!/usr/bin/env bash
echo 'Adding Dell repository...'
# https://www.dell.com/community/XPS/XPS-13-9300-Does-fingerprint-reader-work-on-linux/td-p/7514958
sudo sh -c 'cat > /etc/apt/sources.list.d/focal-dell.list << EOF
deb http://dell.archive.canonical.com/updates/ focal-dell public
# deb-src http://dell.archive.canonical.com/updates/ focal-dell public
deb http://dell.archive.canonical.com/updates/ focal-oem public
# deb-src http://dell.archive.canonical.com/updates/ focal-oem public
@slorber
slorber / generate-docs-from-js.js
Last active June 14, 2024 20:40 — forked from arinthros/generate-docs-from-js
Generate Docusaurus Docs from JSDoc
/**
* Requires jsdoc and jsdoc-to-markdown
*/
/* eslint-disable no-console */
const fs = require('fs')
const path = require('path')
const glob = require('glob')
const { execSync } = require('child_process')
const jsdoc2md = require('jsdoc-to-markdown')
import { enableProdMode } from "@angular/core";
import { disableDebugTools } from "@angular/platform-browser";
import { environment as defaultEnvironment } from "@app/web-env/environment";
import { RUNTIME_CONFIG_KEY } from "@app/web-core";
import { runtimeConfigLoader$ } from "@app/web-env/runtime-config-loader.fn";
import { catchError, concatMap, delay, map, retryWhen, take } from "rxjs/operators";
import { from, of, throwError } from "rxjs";
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
...
@trungvose
trungvose / nx-structure-angular-nestjs.md
Last active March 29, 2025 06:58
Nx workspace structure for NestJS and Angular

Nx

https://nx.dev/

Nx is a suite of powerful, extensible dev tools to help you architect, test, and build at any scale — integrating seamlessly with modern technologies and libraries while providing a robust CLI, caching, dependency management, and more.

It has first-class support for many frontend and backend technologies, so its documentation comes in multiple flavours.

Principles

@sindresorhus
sindresorhus / esm-package.md
Last active April 1, 2025 11:17
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.
@gadflying
gadflying / mockImportedFunction.md
Last active June 25, 2024 10:37
[How to mock imported named function in Jest when module is unmocked] #jest #reactTestLib
// myModule.test.js

jest.mock('./myModule.js', () => (
  {
    ...(jest.requireActual('./myModule.js')),
    otherFn: jest.fn()
  }
))
@htdangkhoa
htdangkhoa / node-logger.js
Created November 18, 2020 05:11
Override node js console.
import { readFileSync } from 'fs';
import { resolve } from 'path';
const pkg = JSON.parse(
readFileSync(resolve(process.cwd(), 'package.json'), 'utf-8').toString(),
);
const DATE_FORMAT = 'DD-MM-YYYY-hh:mm:ss.SSS';
const colors = {