Skip to content

Instantly share code, notes, and snippets.

View burdiuz's full-sized avatar
💭
isotope muffin

Oleg Galaburda burdiuz

💭
isotope muffin
View GitHub Profile
@burdiuz
burdiuz / README.md
Last active December 4, 2018 05:15
Chained set property

Chained Set Property

Set properties

const locked = set(body.style, 'overflow', 'hidden')
  ('background-color', '#eee')
  ('user-select', 'none');

Reset original values

@burdiuz
burdiuz / index.js
Created December 12, 2018 08:58
Getting redirect URL
const getUrlDomainPart = (url) => {
const [part] = url.match(/^https?:\/\/[^\/]+\//) || [];
return part;
};
export const getCurrentUrl = () => {
const url = window.location.href;
@burdiuz
burdiuz / index.js
Last active January 3, 2019 13:48
Steam: Use all consumables from Winter Sale 2018 in inventory
/*
1. go to your inventory and open developers panel, networking tab
2. use one item
3. replace <USER_ID> with your ID and <SESSION_ID> with sessionid from "ajaxactivateconsumable" request
4. run this script from console
I don't have all classid's but you may search for them in inventoy data response
*/
fetch('https://steamcommunity.com/inventory/<USER_ID>/753/6?l=english&count=2000')
.then((response) => response.json())
@burdiuz
burdiuz / .npmignore
Last active March 20, 2019 09:24
@actualwave/redux-promised-action - Promised action creator factory, uses redux-thunk to return promise from dispatch
source.js
@burdiuz
burdiuz / copy.js
Last active March 4, 2019 13:10
Steam curation manage -- copy/paste curated reviews
/*
READ CURATOR LIST
*/
((list) => {
const readApps = () => {
document
.querySelectorAll('.recommendation')
.forEach((node) => {
const item = {
appId: node.querySelector('a[data-ds-appid]').dataset.dsAppid,
@burdiuz
burdiuz / .npmignore
Last active January 12, 2022 11:17
@actualwave/promised-timeout - Function that returns a Promise which will be resolved on timeout
source.js
@burdiuz
burdiuz / README.md
Last active September 17, 2020 08:11
@actualwave/space-wrap -- Inject invisible wrapping spaces after a sequence of special characters and/or spaces

@actualwave/react-space-wrap

Simple functional component that uses regular expression to add zero-width spaces to a string passed into value property and/or children. Zero-width spaces are used to add line breaks which appear when text does not fit into container. It can be used with value property

import SpaceWrap from '@actualwave/react-space-wrap';

export const MyText = () => (
import React, { createContext } from 'react';
import { ErrorHandler } from './withDidCatch';
const { Provider, Consumer } = createContext();
Provider.displayName = 'ErrorBoundaryContextProvider';
Consumer.displayName = 'ErrorBoundaryContextConsumer';
export const ErrorBoundaryProvider = ({ onRenderError }) => (
<Provider value={onRenderError}>{children}</Provider>
@burdiuz
burdiuz / GOG_display_discounts.js
Last active November 30, 2019 08:05
GOG.com display discount in games selection list
document
.querySelectorAll('.product-row__price.product-row__alignment')
.forEach((row) => {
const node = row.querySelector('.product-row-price--old ._price');
const oldPrice = parseFloat(node.innerText);
const newPrice = parseFloat(
row.querySelector('.product-row-price--new ._price').innerText,
);
node.innerText = ` ${((1 - newPrice / oldPrice) * 100) >> 0}%`;
node.parentElement.style.textDecoration = 'none';
@burdiuz
burdiuz / Sort_imports.js
Last active November 20, 2019 09:16
Sort import names after copy-pasting
` Checkbox,
Chip,
DataTable,
Button,
Paragraph,
Dialog,
Portal,
Divider,
Text,
Drawer,