Skip to content

Instantly share code, notes, and snippets.

View wegorich's full-sized avatar
💩
Crappy codding

Egor Malkevich wegorich

💩
Crappy codding
View GitHub Profile
@wegorich
wegorich / index.ts
Last active March 5, 2020 15:01
how work with localmock client
import { from, ApolloClient, HttpLink, InMemoryCache } from '@apollo/client';
import { errorLink } from './error.link';
import * as tags from './posts.resolvers';
const typeDefs = [tags.typeDefs];
const resolvers = [tags.resolvers];
const gqlClient = new ApolloClient({
cache: new InMemoryCache(),
typeDefs,

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
let actionsArray = [];
let types = {};
export function getTypes() {
return types;
}
export function setActionTypes(actions, mutateWith = ['Request', 'Error']) {
if (!actionsArray.length) {
actionsArray = Object.keys(actions);
@wegorich
wegorich / sheet.js
Created July 6, 2018 17:41
how to crawl google docs using node.js
/**
* Simple Node.js script to turn a specific page on a Google Sheet
* into a JSON object for the main purpose of HTML Templating.
*
* @author jonobr1 / http://jonobr1.com
*
*/
/* eslint func-names: ["error", "never"] */
const https = require('https');
const { StringDecoder } = require('string_decoder');
@wegorich
wegorich / sheet.js
Created July 6, 2018 17:41
how to crawl google docs using node.js
/**
* Simple Node.js script to turn a specific page on a Google Sheet
* into a JSON object for the main purpose of HTML Templating.
*
* @author jonobr1 / http://jonobr1.com
*
*/
/* eslint func-names: ["error", "never"] */
const https = require('https');
const { StringDecoder } = require('string_decoder');
@wegorich
wegorich / lalla
Created June 22, 2018 10:15
bank
DEUTSCHE BANK TRUST COMPANY AMERICAS, NEW YORK
BKTRUS33
04-095-326
@wegorich
wegorich / use-store-decorator.ts
Created January 23, 2018 22:27
use-store-decorator.ts make it TS friendly
import { bindActionCreators } from 'redux';
// @ts-ignore
import { simpleActions } from 'redux-pirate-actions';
export abstract class UseStore {
actions: any;
store: any;
private errorTimeout: any;
@wegorich
wegorich / use-store-decorator.js
Created January 11, 2018 13:15
test js decorator to work as class extension aka class mixins
import { bindActionCreators } from 'redux';
import { simpleActions } from 'redux-pirate-actions';
function syncInit() {
this.syncUnsubscribe();
this._sync();
this._unsubscribe = this.store.subscribe(this._sync.bind(this));
}
function syncUnsubscribe() {
@wegorich
wegorich / actions.js
Last active October 4, 2017 13:43
example of usage redux in aurelia.js
// Cause we use `redux-pirate-actions` the actions can be just a functions returned something Object / Promises...
export function clearErrors(data) {
}
export function setRoute(route) {
return {
route: route
};
}
@wegorich
wegorich / create-decorator.js
Last active October 4, 2017 13:32
aurelia.js redux store setup
// it's needs to reduce the includes and simplify store and actions injection.
import { inject } from 'aurelia-framework'
import { bindActionCreators } from 'redux'
import { simpleActions } from 'redux-pirate-actions';
let actionsCallbacks = null;
let actionsWr = null;
export const createDecorator = (actions, store) => (...injectParams) => {