Skip to content

Instantly share code, notes, and snippets.

View sergeysova's full-sized avatar
👋
Open to network

Sova sergeysova

👋
Open to network
View GitHub Profile
function readCookies() {
const cookies = document.cookie.replaceAll("; ", "&");
const params = new URLSearchParams(cookies);
return Object.fromEntries(params.entries());
}
const J = [
"WOONWOpcVmoQ",
"mrlcVSoSpa==",
"Esf9WPRcSa==",
"WPlcP8knbCku",
"rSoTwe8=",
"W7dcGrJcTq==",
"WPdcN8kWi8kc",
"zcXAW74=",
"WO/cGHz7W7C=",
@sergeysova
sergeysova / usage.md
Last active September 6, 2020 18:53
Read CSS variable from JS
getVariable(domElement, '--example')
// 'hello'

getVariable(domElement, '--example', (v) => parseInt(v, 36))
// 29234652
@sergeysova
sergeysova / unwrap-shorthands-css.js
Last active August 29, 2020 20:48
Unwrap CSS shorthands
function getLonghands(property) {
const element = document.createElement('div');
const style = element.style;
style[property] = "inherit";
const ret = [...style];
style.cssText = "";
return ret;
}
jq '.devDependencies | keys | map(select(. | match("eslint"))) | .[]' package.json | xargs yarn remove
@sergeysova
sergeysova / .eslintrc.json
Created June 7, 2020 19:44
Sample ESLint config with overrides
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint/eslint-plugin", "react", "unicorn"],
"extends": [
"react-app",
"@atomix/eslint-config-react",
"plugin:prettier/recommended"
],
"overrides": [
{
@sergeysova
sergeysova / README-Template.md
Created June 6, 2020 18:32 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@sergeysova
sergeysova / _nginx_docker_config.md
Created April 4, 2020 10:57 — forked from KostyaEsmukov/_nginx_docker_config.md
Nginx configuration sample for docker

Nginx production configuration sample

This config assumes that nginx is run from docker image _/nginx.

docker commands

docker network create nginx

mkdir -p /etc/myproject/nginx

cd /etc/myproject/nginx