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 / encode.js
Created December 27, 2019 18:59
Couple utils made to try TransformStream from Node.js core package
/*
echo "48656c6c6f20576f726c64210a" | node encode.js -f hex
echo "€~𝘈Ḇ𝖢𝕯٤ḞԍНǏ𝙅ƘԸ<2c98>𝙉০Ρ𝗤Ɍ𝓢ȚЦ𝒱Ѡ𝓧ƳȤѧᖯć𝗱ễ𝑓𝙜Ⴙ𝞲𝑗𝒌ļṃʼnо𝞎𝒒<1d72><a731>𝙩ừ𝗏ŵ𝒙𝒚ź1234567890" | node encode.js -t hex | node encode.js -f hex
*/
const { Transform } = require('stream');
const { readArgs } = require('./util');
class ConvertEncoding extends Transform {
constructor(from = 'utf8', to = 'utf8') {
super();
@burdiuz
burdiuz / .npmignore
Last active December 15, 2019 17:55
Redux Side Effects
source.js
@burdiuz
burdiuz / metro.config.js
Created December 5, 2019 19:50
Metro bundler config as replacement for rn-nodeify, substitutes nodejs modules for dependencies
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
const path = require('path');
module.exports = {
@burdiuz
burdiuz / .npmignore
Last active November 27, 2019 17:25
Functions to copy properties between projects including read-only, non-enumerable and get/set
source.js
@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,
@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';
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 / 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 = () => (
@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 / 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,