Skip to content

Instantly share code, notes, and snippets.

View burdiuz's full-sized avatar
💭
bubble wrap activity

Oleg Galaburda burdiuz

💭
bubble wrap activity
View GitHub Profile
@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 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 / 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 / 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 / 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 / README.md
Last active April 8, 2019 12:16
Factory functions to create a value storage hidden in a closure

Closure Value

Factory functions to create a value storage hidden in a closure

  • singleValueFactory() - creates storage for a single value
  • valuesMapFactory() - creates storage with Map hidden, allows adding key/value pairs
  • valuesSetFactory() - creates storage with Set hidden, allows adding unique values

Demo on jsFiddle

singleValueFactory()

@burdiuz
burdiuz / README.md
Last active October 2, 2018 13:30
translateJQueryEventsToDOM() - Re-dispatch jQuery events from DOM elements

jQuery events to DOM

Listens for jQuery events to re-dispatch them from DOM element as CustomEvent. To redispatch Bootstrap 4 modal events from modal DOM element

import translateJQueryEventsToDOM from '@actualwave/jquery-events-to-dom';

translateJQueryEventsToDOM()(
  'show.bs.modal',
 'shown.bs.modal',
@burdiuz
burdiuz / README.md
Created October 2, 2018 11:21
deferred() - Simple function to create Promise with exposed `resolve()` and `reject()` handlers.

deferred()

Simple function to create Promise with exposed resolve() and reject() handlers.

import deferred from '@actualwave/deferred';

const { resolve, reject, promise } = deferred();
@burdiuz
burdiuz / README.md
Last active October 6, 2018 21:25
getClass() - Simple function wrapper over `Object.getPrototypeOf()`.

getClass()

Simple function wrapper over Object.getPrototypeOf().
Additionally provides functions to getClassName() and getParentClass().

Demo on jsFiddle.

@burdiuz
burdiuz / README.md
Last active May 28, 2018 17:22
Wrapper over new Proxy() that adds handlers for apply and construct traps for function targets.

withProxy

Factory generator for wrapping objects with Proxy. Applies construct and apply traps to function targets.

const myFactory = withProxy({
  get: myGetHandler,
  set: mySetHandler,
  apply: myApplyHandler,
  construct: myConstructHandler,
});