Skip to content

Instantly share code, notes, and snippets.

View artginzburg's full-sized avatar
🤍
const crazy = new Genius();

Arthur Ginzburg artginzburg

🤍
const crazy = new Genius();
View GitHub Profile

GitHub Pages + React Router

The whole setting prevents static routing from ruining the UX by synchronizing your production and development implementations, so they act identically and effectively.

Just type git.io/gh-pages-with-react-router to go here

TL;DR

# package.json
@artginzburg
artginzburg / toClassNames.js
Last active July 27, 2021 08:50
Perfectly valid React className from an Array · without falsy values
export const toClassNames = (arr) => arr.filter(Boolean).join(' ');
export const classNames = (arr) => ({ className: toClassNames(arr) });
@artginzburg
artginzburg / puppeteer-chromium-macOS-Firewall-popup-stop.md
Last active October 26, 2022 12:12
 The solution to "Do you want to the application Chromium.app to accept incoming network connections" on every launch

For macOS to stop showing the puppeteer firewall popup

  1. Get to the root of your npm project directory (cd <repo>)

  2. Paste the following command in your shell:

sudo codesign --force --deep --sign - ./node_modules/puppeteer/.local-chromium/
@artginzburg
artginzburg / quine.js
Last active September 23, 2021 19:26
Legal JS quine — no `console.log`, `eval` or reading source code • Test with `$ node test` or just paste into your browser console
($=_=>`($=${$})()`)()
@artginzburg
artginzburg / selfsign.sh
Created October 3, 2021 15:26
HTTPS with Express.js
openssl req -nodes -new -x509 -keyout server.key -out server.cert
@artginzburg
artginzburg / squircles.md
Created December 6, 2021 19:25
storing these links here to write a flexible self-documenting SCSS solution on Codepen later

Keybase proof

I hereby claim:

  • I am artginzburg on github.
  • I am aginzburg (https://keybase.io/aginzburg) on keybase.
  • I have a public key ASCHV0i_4u0FsLB1mPJCAKXf1HBj4NAaViD9JY8mYpe6FAo

To claim this, I am signing this object:

@artginzburg
artginzburg / firefoxDragEventPatch.js
Last active April 5, 2022 21:06
A drop-in patch for Firefox "dragend" and other DragEvent events.
/* eslint-disable func-names, no-underscore-dangle, no-useless-escape, no-mixed-operators */
/**
* A drop-in patch for Firefox "dragend" and other {@link DragEvent} events.
* @author Codesmith <https://bugzilla.mozilla.org/show_bug.cgi?id=505521#c87>
* @see {@link https://bugzilla.mozilla.org/show_bug.cgi?id=505521 Bugzilla: Bug #505521}
*
* @version 0.1.0
* @link https://gist.github.com/artginzburg/791ea42fb687bc7ca0144e7cc4a1f925
* @example React.useEffect(firefoxDragEventPatch, []);
*/
@artginzburg
artginzburg / choosePort.md
Last active April 17, 2022 00:48
Something is already running on port 6969

Problem

Have you ever encountered something like Error: listen EADDRINUSE: address already in use :::3000 when your app is starting?

After which you have to change the port or shutdown whatever is running on the already used one...

Solution

npm i react-dev-utils
@artginzburg
artginzburg / bash-ruleset.md
Last active January 2, 2023 03:14
Bash ruleset with real-world examples

Note: I'll add my opinion to individual rules once I experience enough of the issue related to it.

  1. Full paths to binaries.

    Some systems do not have default aliases for some of the CLIs installed (or that may be installed by the user). So it is quite often required to specify the absolute binary path.

    Example

-sudo sed -n '3,5p' textfile.txt